adapt shift output
This commit is contained in:
@@ -489,9 +489,12 @@ def inspect(ctx, shift, filenames):
|
|||||||
episode=episode,
|
episode=episode,
|
||||||
patternId=currentPattern.getId() if currentPattern is not None else None,
|
patternId=currentPattern.getId() if currentPattern is not None else None,
|
||||||
)
|
)
|
||||||
click.echo(
|
if shiftedSeason == season and shiftedEpisode == episode:
|
||||||
f"{filename}: {season}/{episode} -> {shiftedSeason}/{shiftedEpisode} from {sourceLabel}"
|
click.echo(f"{filename}: none")
|
||||||
)
|
else:
|
||||||
|
click.echo(
|
||||||
|
f"{filename}: {season}/{episode} -> {shiftedSeason}/{shiftedEpisode} from {sourceLabel}"
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(filenames) != 1:
|
if len(filenames) != 1:
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ class InspectShiftCliTests(unittest.TestCase):
|
|||||||
self.source_dir.mkdir()
|
self.source_dir.mkdir()
|
||||||
self.mapped_path = self.source_dir / "mapped.mkv"
|
self.mapped_path = self.source_dir / "mapped.mkv"
|
||||||
self.mapped_path.write_bytes(b"mapped")
|
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 = self.source_dir / "unknown.mkv"
|
||||||
self.unknown_path.write_bytes(b"unknown")
|
self.unknown_path.write_bytes(b"unknown")
|
||||||
|
|
||||||
@@ -94,6 +96,7 @@ class InspectShiftCliTests(unittest.TestCase):
|
|||||||
"inspect",
|
"inspect",
|
||||||
"--shift",
|
"--shift",
|
||||||
str(self.mapped_path),
|
str(self.mapped_path),
|
||||||
|
str(self.identity_path),
|
||||||
str(self.unknown_path),
|
str(self.unknown_path),
|
||||||
],
|
],
|
||||||
env={**os.environ, "HOME": str(self.home_dir)},
|
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",
|
f"{self.mapped_path}: 1/3 -> 2/1 from pattern",
|
||||||
result.output,
|
result.output,
|
||||||
)
|
)
|
||||||
|
self.assertIn(
|
||||||
|
f"{self.identity_path}: none",
|
||||||
|
result.output,
|
||||||
|
)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
f"{self.unknown_path}: no season/episode recognized",
|
f"{self.unknown_path}: no season/episode recognized",
|
||||||
result.output,
|
result.output,
|
||||||
|
|||||||
Reference in New Issue
Block a user