From b92386629a88d772a0921135ff6cab1c2c14fbc7 Mon Sep 17 00:00:00 2001 From: RiveN <61630074+RiveN000@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:13:56 +0200 Subject: [PATCH] Fixed bug After adding "__comment" to the backgrounds.json file code crashed because it treated "__comment" as one of the backgrounds. --- video_creation/background.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/video_creation/background.py b/video_creation/background.py index ecddec2..1089d29 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -18,7 +18,12 @@ with open("utils/backgrounds.json") as json_file: # Add position lambda function # (https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html#moviepy.video.VideoClip.VideoClip.set_position) -for name in list(background_options.keys()): +backgrounds = list(background_options.keys()) + +if "__comment" in backgrounds: + backgrounds.remove("__comment") + +for name in backgrounds: pos = background_options[name][3] if pos != "center":