summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorVitiko <[email protected]>2023-03-10 18:12:37 -0400
committerVitiko <[email protected]>2023-03-10 18:12:37 -0400
commit587af7d138f1b11e034c16a70b1032a8932cc59c (patch)
tree8afabad720a88b14e18fc7ca6d84ba087b41dc47 /libs
parentdec2f7d4788d720ad9503220050ae83e7c6462e0 (diff)
downloadbazarr-587af7d138f1b11e034c16a70b1032a8932cc59c.tar.gz
bazarr-587af7d138f1b11e034c16a70b1032a8932cc59c.zip
Supersubtitles provider: fix #2092v1.2.1-beta.1
Diffstat (limited to 'libs')
-rw-r--r--libs/subliminal_patch/providers/supersubtitles.py29
1 files changed, 6 insertions, 23 deletions
diff --git a/libs/subliminal_patch/providers/supersubtitles.py b/libs/subliminal_patch/providers/supersubtitles.py
index 7f779fedb..e19bf629e 100644
--- a/libs/subliminal_patch/providers/supersubtitles.py
+++ b/libs/subliminal_patch/providers/supersubtitles.py
@@ -59,19 +59,6 @@ class SuperSubtitlesSubtitle(Subtitle):
"""SuperSubtitles Subtitle."""
provider_name = 'supersubtitles'
- def __str__(self):
- subtit = "Subtitle id: " + str(self.subtitle_id) \
- + " Series: " + self.series \
- + " Season: " + str(self.season) \
- + " Episode: " + str(self.episode) \
- + " Version: " + str(self.version) \
- + " Releases: " + str(self.releases) \
- + " DownloadLink: " + str(self.page_link) \
- + " Matches: " + str(self.matches)
- if self.year:
- subtit = subtit + " Year: " + str(self.year)
- return subtit.encode('utf-8')
-
def __init__(self, language, page_link, subtitle_id, series, season, episode, version,
releases, year, imdb_id, uploader, asked_for_episode=None, asked_for_release_group=None):
super(SuperSubtitlesSubtitle, self).__init__(language, page_link=page_link)
@@ -86,8 +73,7 @@ class SuperSubtitlesSubtitle(Subtitle):
if year:
self.year = int(year)
- self.release_info = u" ,".join([u"%s (%s)" % (self.__get_name(), releases[0])] +
- (releases[1:] if len(releases) > 1 else []))
+ self.release_info = "\n".join([self.__get_name(), *self.releases])
self.page_link = page_link
self.asked_for_release_group = asked_for_release_group
self.asked_for_episode = asked_for_episode
@@ -98,18 +84,15 @@ class SuperSubtitlesSubtitle(Subtitle):
def numeric_id(self):
return self.subtitle_id
- def __get_name(self):
- ep_addon = (" S%02dE%02d" % (self.season, self.episode)) if self.episode else ""
- return u"%s%s%s" % (self.series, " (%s)" % self.year if self.year else "", ep_addon)
-
- def __repr__(self):
- return '<%s %r [%s]>' % (
- self.__class__.__name__, u"%s [%s]" % (self.__get_name(), self.version), self.language)
-
@property
def id(self):
return str(self.subtitle_id)
+ def __get_name(self):
+ ep_addon = f"S{self.season:02}E{self.episode:02}" if self.episode else ""
+ year_str = f" ({self.year})"
+ return f"{self.series}{year_str or ''} {ep_addon}".strip()
+
def get_matches(self, video):
matches = set()
update_matches(matches, video, self.releases)