From 294d3eb0eefdd5aad177d4ea08f57eebd9e7bf02 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Mon, 11 Oct 2021 14:33:10 -0400 Subject: [PATCH] Added support for series to provider Titrari.ro --- libs/subliminal_patch/providers/titrari.py | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/libs/subliminal_patch/providers/titrari.py b/libs/subliminal_patch/providers/titrari.py index 967aca6cb..ccbafe548 100644 --- a/libs/subliminal_patch/providers/titrari.py +++ b/libs/subliminal_patch/providers/titrari.py @@ -86,6 +86,24 @@ def get_matches(self, video): matches.add('release_group') matches |= guess_matches(video, guessit(self.comments, {"type": "movie"})) + else: + # title + if video.series and fix_inconsistent_naming(video.series) in sanitize(self.title): + matches.add('series') + + if video.year and self.year == video.year: + matches.add('year') + + if video.series_imdb_id and self.imdb_id == video.series_imdb_id: + matches.add('imdb_id') + + if video.release_group and video.release_group in self.comments: + matches.add('release_group') + + if f"Sezonul {video.season}" in self.title: + matches.add('season') + + matches |= guess_matches(video, guessit(self.comments, {"type": "episode"})) self.matches = matches @@ -220,7 +238,10 @@ def list_subtitles(self, video, languages): title = fix_inconsistent_naming(video.title) imdb_id = None try: - imdb_id = video.imdb_id[2:] + if isinstance(video, Episode): + imdb_id = video.series_imdb_id[2:] + else: + imdb_id = video.imdb_id[2:] except: logger.error("[#### Provider: titrari.ro] Error parsing video.imdb_id.")