Skip to content

Commit

Permalink
kdenlive shows output path
Browse files Browse the repository at this point in the history
  • Loading branch information
dunossauro committed Aug 28, 2023
1 parent ceab14f commit 6b83e86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
20 changes: 11 additions & 9 deletions vmh/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,17 @@ def kdenlive(
logger.info(f'Deleting {output_path}')
output_path.unlink()

cut(
audio_file.resolve(),
video_file.resolve(),
input_xml.resolve(),
output_path.resolve(),
silence_time,
threshold,
force,
distance.value,
console.print(
cut(
audio_file.resolve(),
video_file.resolve(),
input_xml.resolve(),
output_path.resolve(),
silence_time,
threshold,
force,
distance.value,
)
)


Expand Down
11 changes: 7 additions & 4 deletions vmh/kdenlive.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def kdenlive_xml(
}
entry = ET.SubElement(playlist, 'entry', attrib=entry_attribs)

# Property
ET.SubElement(entry, 'property', attrib={'name': 'kdenlive:id'}, text=property_id)
ET.SubElement(
entry, 'property', attrib={'name': 'kdenlive:id'}, text=property_id
)

if overwrite:
tree.write(path)
Expand All @@ -96,7 +97,7 @@ def cut(
distance: Literal[
'negative', 'tiny', 'small', 'medium', 'large', 'huge'
] = 'tiny',
) -> None:
) -> Path:
if audio_file != Path(getcwd()): # Typer don't support Path | None
times = detect_silences(
str(audio_file), silence_time, threshold, distance, force=force
Expand All @@ -113,7 +114,7 @@ def cut(
property_id=file_id,
chain_id=chain_id,
cuts=times,
output_path=str(output_path)
output_path=str(output_path),
)
logger.info(f'Video playlist {playlist}')

Expand All @@ -139,3 +140,5 @@ def cut(
output_path=_output_path,
)
logger.info(f'Audio playlist {playlist}')

return Path(_output_path).resolve()

0 comments on commit 6b83e86

Please sign in to comment.