Change title attribute to be standard
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "1.0.1"
|
||||
__version__ = "1.0.2"
|
||||
|
||||
@@ -24,6 +24,7 @@ class Release:
|
||||
self.seed_status: Optional[SeedStatus] = None
|
||||
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_name: Optional[str] = None
|
||||
self.quality: Optional[Resolution] = None
|
||||
|
||||
@@ -11,7 +11,6 @@ class MovieRelease(Release):
|
||||
|
||||
def __init__(self, unparsed_text, dl_link, **kwargs):
|
||||
super().__init__(unparsed_text, dl_link, **kwargs)
|
||||
self.title: str = ""
|
||||
self.year: int = 0
|
||||
self.edition: Optional[str] = None
|
||||
|
||||
|
||||
@@ -10,11 +10,10 @@ class TVBoxSetRelease(Release):
|
||||
"""Holds info representing a release of a TV box set."""
|
||||
def __init__(self, unparsed_text, dl_link, **kwargs):
|
||||
super().__init__(unparsed_text, dl_link, **kwargs)
|
||||
self.show_title: str = ""
|
||||
self.seasons: Optional[str] = None
|
||||
|
||||
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']:
|
||||
value = getattr(self, attr)
|
||||
parts.append(f"{attr.capitalize()}: {value if value else 'Unknown'}")
|
||||
|
||||
@@ -45,7 +45,7 @@ class TitleSeasonsParser(DataParser, TVBoxSetParser):
|
||||
for pattern in patterns:
|
||||
match = pattern.match(self.release.original_text)
|
||||
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_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}"
|
||||
|
||||
Reference in New Issue
Block a user