diff --git a/mnamer/metadata.py b/mnamer/metadata.py index 11cc9546..8ae5674b 100644 --- a/mnamer/metadata.py +++ b/mnamer/metadata.py @@ -42,6 +42,7 @@ class Metadata: quality: str = None synopsis: str = None media: MediaType = None + original: str = None def __setattr__(self, key: str, value: Any): converter = { diff --git a/mnamer/target.py b/mnamer/target.py index 1a94f7de..f013c203 100644 --- a/mnamer/target.py +++ b/mnamer/target.py @@ -150,6 +150,7 @@ def _parse(self, file_path: PurePath): None: Metadata, }[media_type] self.metadata = meta_cls(language=self._settings.language) + self.metadata.original = self.source.name self.metadata.quality = ( " ".join( path_data[key] diff --git a/tests/e2e/test_moving.py b/tests/e2e/test_moving.py index 8a710013..0a912a59 100644 --- a/tests/e2e/test_moving.py +++ b/tests/e2e/test_moving.py @@ -215,3 +215,15 @@ def test_ambiguous_language_deletction(e2e_run, setup_test_files): setup_test_files("Harry Potter and the Sorcerer's Stone 2001 Ultimate Extended Edition 1080p - KRaLiMaRKo.mkv") result = e2e_run("--batch", ".") assert result.code == 0 + + +@pytest.mark.usefixtures("setup_test_dir") +def test_original_filename(e2e_run, setup_test_files): + setup_test_files("archer.2009.s10e07.webrip.x264-lucidtv.mp4") + result = e2e_run( + "--batch", + "--episode-format='{original}'", + ".", + ) + assert result.code == 0 + assert "archer.2009.s10e07.webrip.x264-lucidtv.mp4" in result.out