Skip to content

Commit

Permalink
Added 'release name' movie formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas2k committed Nov 30, 2023
1 parent 0ddff8d commit 11418b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mnamer/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class MetadataMovie(Metadata):

name: str | None = None
year: str | None = None
release_name: str | None = None
id_imdb: str | None = None
id_tmdb: str | None = None

Expand Down
2 changes: 2 additions & 0 deletions mnamer/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def _parse(self, file_path: Path):
file_path = Path(self.source.parent, self.source.stem[:-2])
except MnamerException:
pass
path_data["release_name"] = file_path.parent.name
options = {"type": self._settings.media, "language": path_data["language"]}
raw_data = dict(guessit(str(file_path), options))
if isinstance(raw_data.get("season"), list):
Expand Down Expand Up @@ -179,6 +180,7 @@ def _parse(self, file_path: Path):
if isinstance(self.metadata, MetadataMovie):
self.metadata.name = path_data.get("title")
self.metadata.year = path_data.get("year")
self.metadata.release_name = path_data.get("release_name")
elif isinstance(self.metadata, MetadataEpisode):
self.metadata.date = path_data.get("date")
self.metadata.episode = path_data.get("episode")
Expand Down

0 comments on commit 11418b5

Please sign in to comment.