diff options
author | morpheus65535 <[email protected]> | 2021-10-12 00:08:11 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-10-12 00:08:11 -0400 |
commit | aec3aceda377ba25364ea89a5fc26c0f163b42f5 (patch) | |
tree | 8c9f63c0b658324bf59806f3c0daa06f8b3f19ad | |
parent | 3f7abc9ddca1eb619a6154b69ecf59f17bd4dac3 (diff) | |
download | bazarr-aec3aceda377ba25364ea89a5fc26c0f163b42f5.tar.gz bazarr-aec3aceda377ba25364ea89a5fc26c0f163b42f5.zip |
no log: more improvementsv0.9.10-beta.12
-rw-r--r-- | libs/subliminal_patch/providers/titrari.py | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/libs/subliminal_patch/providers/titrari.py b/libs/subliminal_patch/providers/titrari.py index 2a4008923..8710f578a 100644 --- a/libs/subliminal_patch/providers/titrari.py +++ b/libs/subliminal_patch/providers/titrari.py @@ -48,8 +48,8 @@ class TitrariSubtitle(Subtitle): provider_name = 'titrari' - def __init__(self, language, download_link, sid, releases, title, imdb_id, year=None, download_count=None, - comments=None, is_episode=False, desired_episode=None): + def __init__(self, language, download_link, sid, comments, title, imdb_id, year=None, download_count=None, + is_episode=False, desired_episode=None): super(TitrariSubtitle, self).__init__(language) self.sid = sid self.title = title @@ -57,8 +57,7 @@ class TitrariSubtitle(Subtitle): self.download_link = download_link self.year = year self.download_count = download_count - self.releases = self.release_info = releases - self.comments = comments + self.comments = self.releases = self.release_info = " /".join(comments.split(",")) self.matches = None self.is_episode = is_episode self.desired_episode = desired_episode @@ -195,8 +194,8 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin): logger.error("Error parsing comments.") episode_number = video.episode if isinstance(video, Episode) else None - subtitle = self.subtitle_class(next(iter(languages)), download_link, index, None, title, sub_imdb_id, - year, downloads, comments, isinstance(video, Episode), episode_number) + subtitle = self.subtitle_class(next(iter(languages)), download_link, index, comments, title, sub_imdb_id, + year, downloads, isinstance(video, Episode), episode_number) logger.debug('[#### Provider: titrari.ro] Found subtitle %r', str(subtitle)) subtitles.append(subtitle) @@ -287,7 +286,6 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin): raise ProviderError('[#### Provider: titrari.ro] Unidentified archive type') - subtitle.releases = _get_releases_from_archive(archive) if subtitle.is_episode: subtitle.content = self._get_subtitle_from_archive(subtitle, archive) else: @@ -309,19 +307,3 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin): return archive.read(name) return None - - -def _get_releases_from_archive(archive): - releases = [] - for name in archive.namelist(): - # discard hidden files - if os.path.split(name)[-1].startswith('.'): - continue - - # discard non-subtitle files - if not name.lower().endswith(SUBTITLE_EXTENSIONS): - continue - - releases.append(os.path.splitext(os.path.split(name)[1])[0]) - - return releases |