Skip to content

Commit

Permalink
Added support for series to provider Titrari.ro
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Oct 11, 2021
1 parent d851c16 commit 294d3eb
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion libs/subliminal_patch/providers/titrari.py
Expand Up @@ -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

Expand Down Expand Up @@ -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.")

Expand Down

0 comments on commit 294d3eb

Please sign in to comment.