Change title attribute to be standard

This commit is contained in:
2026-03-20 21:34:40 -04:00
parent 74753d94be
commit 8f58d8db82
5 changed files with 4 additions and 5 deletions

View File

@@ -1 +1 @@
__version__ = "1.0.1" __version__ = "1.0.2"

View File

@@ -24,6 +24,7 @@ class Release:
self.seed_status: Optional[SeedStatus] = None self.seed_status: Optional[SeedStatus] = None
self.parser_results: dict[str, bool] = {} # Stores which parsers have been run and their results. self.parser_results: dict[str, bool] = {} # Stores which parsers have been run and their results.
self.title: Optional[str] = None
self.group: Optional[Group] = None self.group: Optional[Group] = None
self.group_name: Optional[str] = None self.group_name: Optional[str] = None
self.quality: Optional[Resolution] = None self.quality: Optional[Resolution] = None

View File

@@ -11,7 +11,6 @@ class MovieRelease(Release):
def __init__(self, unparsed_text, dl_link, **kwargs): def __init__(self, unparsed_text, dl_link, **kwargs):
super().__init__(unparsed_text, dl_link, **kwargs) super().__init__(unparsed_text, dl_link, **kwargs)
self.title: str = ""
self.year: int = 0 self.year: int = 0
self.edition: Optional[str] = None self.edition: Optional[str] = None

View File

@@ -10,11 +10,10 @@ class TVBoxSetRelease(Release):
"""Holds info representing a release of a TV box set.""" """Holds info representing a release of a TV box set."""
def __init__(self, unparsed_text, dl_link, **kwargs): def __init__(self, unparsed_text, dl_link, **kwargs):
super().__init__(unparsed_text, dl_link, **kwargs) super().__init__(unparsed_text, dl_link, **kwargs)
self.show_title: str = ""
self.seasons: Optional[str] = None self.seasons: Optional[str] = None
def __str__(self): def __str__(self):
parts = [f"{self.show_title} (Seasons: {self.seasons})"] parts = [f"{self.title} (Seasons: {self.seasons})"]
for attr in ['quality', 'video_codec', 'audio_codec', 'audio_layout', 'dynamic_range', 'repack', 'multi', 'source']: for attr in ['quality', 'video_codec', 'audio_codec', 'audio_layout', 'dynamic_range', 'repack', 'multi', 'source']:
value = getattr(self, attr) value = getattr(self, attr)
parts.append(f"{attr.capitalize()}: {value if value else 'Unknown'}") parts.append(f"{attr.capitalize()}: {value if value else 'Unknown'}")

View File

@@ -45,7 +45,7 @@ class TitleSeasonsParser(DataParser, TVBoxSetParser):
for pattern in patterns: for pattern in patterns:
match = pattern.match(self.release.original_text) match = pattern.match(self.release.original_text)
if match: if match:
self.release.show_title = match.group("title").replace(".", " ").replace("_", " ").strip() if match.group("title") else "" self.release.title = match.group("title").replace(".", " ").replace("_", " ").strip() if match.group("title") else ""
season_start = int(match.group("season_start")) if match.group("season_start") else 0 season_start = int(match.group("season_start")) if match.group("season_start") else 0
season_end = int(match.group("season_end")) if "season_end" in match.groupdict() and match.group("season_end") else season_start season_end = int(match.group("season_end")) if "season_end" in match.groupdict() and match.group("season_end") else season_start
self.release.seasons = f"{season_start}" if season_start == season_end else f"{season_start}-{season_end}" self.release.seasons = f"{season_start}" if season_start == season_end else f"{season_start}-{season_end}"