adapt shift output
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user