From cbf43e5d6ce930cd86d55b75d873d75ed5dcef93 Mon Sep 17 00:00:00 2001 From: Javanaut Date: Sun, 12 Apr 2026 20:41:31 +0200 Subject: [PATCH] adapt shift output --- src/ffx/cli.py | 9 ++++++--- tests/unit/test_cli_inspect_shift.py | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ffx/cli.py b/src/ffx/cli.py index 77c3b66..9cf1328 100755 --- a/src/ffx/cli.py +++ b/src/ffx/cli.py @@ -489,9 +489,12 @@ def inspect(ctx, shift, filenames): episode=episode, patternId=currentPattern.getId() if currentPattern is not None else None, ) - click.echo( - f"{filename}: {season}/{episode} -> {shiftedSeason}/{shiftedEpisode} from {sourceLabel}" - ) + if shiftedSeason == season and shiftedEpisode == episode: + click.echo(f"{filename}: none") + else: + click.echo( + f"{filename}: {season}/{episode} -> {shiftedSeason}/{shiftedEpisode} from {sourceLabel}" + ) return if len(filenames) != 1: diff --git a/tests/unit/test_cli_inspect_shift.py b/tests/unit/test_cli_inspect_shift.py index 53ec0c0..167d3bf 100644 --- a/tests/unit/test_cli_inspect_shift.py +++ b/tests/unit/test_cli_inspect_shift.py @@ -70,6 +70,8 @@ class InspectShiftCliTests(unittest.TestCase): self.source_dir.mkdir() self.mapped_path = self.source_dir / "mapped.mkv" self.mapped_path.write_bytes(b"mapped") + self.identity_path = self.source_dir / "identity.mkv" + self.identity_path.write_bytes(b"identity") self.unknown_path = self.source_dir / "unknown.mkv" self.unknown_path.write_bytes(b"unknown") @@ -94,6 +96,7 @@ class InspectShiftCliTests(unittest.TestCase): "inspect", "--shift", str(self.mapped_path), + str(self.identity_path), str(self.unknown_path), ], env={**os.environ, "HOME": str(self.home_dir)}, @@ -104,6 +107,10 @@ class InspectShiftCliTests(unittest.TestCase): f"{self.mapped_path}: 1/3 -> 2/1 from pattern", result.output, ) + self.assertIn( + f"{self.identity_path}: none", + result.output, + ) self.assertIn( f"{self.unknown_path}: no season/episode recognized", result.output,