mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-10 16:57:45 +08:00
fix(wizdom): release doesn't show in manual search results and scoring calculation
This commit is contained in:
parent
2fdc0dbdad
commit
be37a8112e
1 changed files with 38 additions and 0 deletions
|
@ -40,8 +40,13 @@ class WizdomSubtitle(Subtitle):
|
|||
def id(self):
|
||||
return str(self.subtitle_id)
|
||||
|
||||
@property
|
||||
def release_info(self):
|
||||
return self.release
|
||||
|
||||
def get_matches(self, video):
|
||||
matches = set()
|
||||
subtitle_filename = self.release.lower()
|
||||
|
||||
# episode
|
||||
if isinstance(video, Episode):
|
||||
|
@ -70,6 +75,39 @@ class WizdomSubtitle(Subtitle):
|
|||
sanitize(name) for name in [video.title] + video.alternative_titles)):
|
||||
matches.add('title')
|
||||
|
||||
# release_group
|
||||
if video.release_group and video.release_group.lower() in subtitle_filename:
|
||||
matches.add('release_group')
|
||||
|
||||
# resolution
|
||||
if video.resolution and video.resolution.lower() in subtitle_filename:
|
||||
matches.add('resolution')
|
||||
|
||||
# source
|
||||
formats = []
|
||||
if video.source:
|
||||
formats = [video.source.lower()]
|
||||
if formats[0] == "web":
|
||||
formats.append("webdl")
|
||||
formats.append("webrip")
|
||||
formats.append("web ")
|
||||
for frmt in formats:
|
||||
if frmt.lower() in subtitle_filename:
|
||||
matches.add('source')
|
||||
break
|
||||
|
||||
# video_codec
|
||||
if video.video_codec:
|
||||
video_codecs = [video.video_codec.lower()]
|
||||
if video_codecs[0] == "h.264":
|
||||
formats.append("x264")
|
||||
elif video_codecs[0] == "h.265":
|
||||
formats.append("x265")
|
||||
for vc in formats:
|
||||
if vc.lower() in subtitle_filename:
|
||||
matches.add('video_codec')
|
||||
break
|
||||
|
||||
return matches
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue