From faabfb550c43ad9b5d1a9d95ee4ed5bea4e11e30 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 10 Feb 2023 19:13:31 +0000 Subject: [PATCH] Replace use of with_stem + with_suffix to with_name --- devine/commands/util.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/devine/commands/util.py b/devine/commands/util.py index d2b7e56..49b1f27 100644 --- a/devine/commands/util.py +++ b/devine/commands/util.py @@ -74,16 +74,17 @@ def crop(path: Path, aspect: str, letter: bool, offset: int, preview: bool) -> N if preview: out_path = ["-f", "mpegts", "-"] # pipe else: - out_path = [str(video_path.with_stem(".".join(filter(bool, [ + out_path = [str(video_path.with_name(".".join(filter(bool, [ video_path.stem, video_track.language, "crop", - str(offset or "") - ]))).with_suffix({ - # ffmpeg's MKV muxer does not yet support HDR - "HEVC": ".h265", - "AVC": ".h264" - }.get(video_track.commercial_name, ".mp4")))] + str(offset or ""), + { + # ffmpeg's MKV muxer does not yet support HDR + "HEVC": "h265", + "AVC": "h264" + }.get(video_track.commercial_name, ".mp4") + ]))))] ffmpeg_call = subprocess.Popen([ executable, "-y", @@ -143,16 +144,17 @@ def range_(path: Path, full: bool, preview: bool) -> None: if preview: out_path = ["-f", "mpegts", "-"] # pipe else: - out_path = [str(video_path.with_stem(".".join(filter(bool, [ + out_path = [str(video_path.with_name(".".join(filter(bool, [ video_path.stem, video_track.language, "range", - ["limited", "full"][full] - ]))).with_suffix({ - # ffmpeg's MKV muxer does not yet support HDR - "HEVC": ".h265", - "AVC": ".h264" - }.get(video_track.commercial_name, ".mp4")))] + ["limited", "full"][full], + { + # ffmpeg's MKV muxer does not yet support HDR + "HEVC": "h265", + "AVC": "h264" + }.get(video_track.commercial_name, ".mp4") + ]))))] ffmpeg_call = subprocess.Popen([ executable, "-y",