Fixed bug (better implementation)

After adding "__comment" to the backgrounds.json file code crashed because it treated "__comment" as one of the backgrounds.
This commit is contained in:
RiveN authored and GitHub committed 2022-08-22 14:22:35 +02:00
1 parent b92386629a
commit afbffa1b50
1 file changed
+4 -6
+4 -6
View File
@@ -16,14 +16,12 @@ from utils.console import print_step, print_substep
with open("utils/backgrounds.json") as json_file:
background_options = json.load(json_file)
# Remove "__comment" from backgrounds
background_options.pop("__comment", None)
# Add position lambda function
# (https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html#moviepy.video.VideoClip.VideoClip.set_position)
backgrounds = list(background_options.keys())
if "__comment" in backgrounds:
backgrounds.remove("__comment")
for name in backgrounds:
for name in list(background_options.keys()):
pos = background_options[name][3]
if pos != "center":