Skip to content

Commit bf55e71

Browse files
committed
[cli] Fix wrong arg name passed to export-html command.
1 parent 47bfecd commit bf55e71

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

scenedetect/_cli/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,15 +1045,16 @@ def save_html_command(
10451045
logger.warning("WARNING: export-html is deprecated, use save-html instead.")
10461046
ctx = ctx.obj
10471047
assert isinstance(ctx, CliContext)
1048+
# Make sure a save-images command is in the pipeline for us to use the results from if we need
1049+
# to include images.
10481050
include_images = not ctx.config.get_value("save-html", "no-images", no_images)
1049-
# Make sure a save-images command is in the pipeline for us to use the results from.
10501051
if include_images and not ctx.save_images:
10511052
save_images_command.callback()
10521053
save_html_args = {
10531054
"filename": ctx.config.get_value("save-html", "filename", filename),
10541055
"image_width": ctx.config.get_value("save-html", "image-width", image_width),
10551056
"image_height": ctx.config.get_value("save-html", "image-height", image_height),
1056-
"include_images": include_images,
1057+
"no_images": ctx.config.get_value("save-html", "no-images", no_images),
10571058
"show": ctx.config.get_value("save-html", "show", show),
10581059
}
10591060
ctx.add_command(cli_commands.save_html, save_html_args)

scenedetect/_cli/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def save_html(
4747
cuts: CutList,
4848
image_width: int,
4949
image_height: int,
50-
html_name_format: str,
51-
include_images: bool,
50+
filename: str,
51+
no_images: bool,
5252
show: bool,
5353
):
5454
"""Handles the `save-html` command."""
@@ -58,15 +58,15 @@ def save_html(
5858
else (None, context.output)
5959
)
6060

61-
html_filename = Template(html_name_format).safe_substitute(VIDEO_NAME=context.video_stream.name)
61+
html_filename = Template(filename).safe_substitute(VIDEO_NAME=context.video_stream.name)
6262
if not html_filename.lower().endswith(".html"):
6363
html_filename += ".html"
6464
html_path = get_and_create_path(html_filename, output)
6565
write_scene_list_html(
6666
output_html_filename=html_path,
6767
scene_list=scenes,
6868
cut_list=cuts,
69-
image_filenames=image_filenames if include_images else None,
69+
image_filenames=None if no_images else image_filenames,
7070
image_width=image_width,
7171
image_height=image_height,
7272
)

0 commit comments

Comments
 (0)