mirror of
https://github.com/zoriya/guessit.git
synced 2026-06-07 20:21:36 +00:00
#590: 'Fixes Show Name/Season SS/Ep. EE - Title' pattern
This commit is contained in:
@@ -629,10 +629,11 @@ class RemoveWeak(Rule):
|
||||
Remove weak-episode matches which appears after video, source, and audio matches.
|
||||
"""
|
||||
priority = 16
|
||||
consequence = RemoveMatch
|
||||
consequence = RemoveMatch, AppendMatch
|
||||
|
||||
def when(self, matches, context):
|
||||
to_remove = []
|
||||
to_append = []
|
||||
for filepart in matches.markers.named('path'):
|
||||
weaks = matches.range(filepart.start, filepart.end, predicate=lambda m: 'weak-episode' in m.tags)
|
||||
if weaks:
|
||||
@@ -641,8 +642,18 @@ class RemoveWeak(Rule):
|
||||
'audio_channels', 'audio_profile'), index=0)
|
||||
if previous and not matches.holes(
|
||||
previous.end, weaks[0].start, predicate=lambda m: m.raw.strip(seps)):
|
||||
if previous.raw.lower() == 'ep':
|
||||
episode = copy.copy(weaks[0])
|
||||
episode.name = 'episode'
|
||||
episode.value = int(weaks[0].value)
|
||||
episode.start = previous.start
|
||||
episode.private = False
|
||||
episode.tags = []
|
||||
|
||||
to_append.append(episode)
|
||||
|
||||
to_remove.extend(weaks)
|
||||
return to_remove
|
||||
return to_remove, to_append
|
||||
|
||||
|
||||
class RemoveWeakIfSxxExx(Rule):
|
||||
|
||||
@@ -4617,3 +4617,10 @@
|
||||
video_codec: H.264
|
||||
release_group: KILLERS
|
||||
type: episode
|
||||
|
||||
? /mnt/NAS/NoSubsTVShows/Babylon 5/Season 01/Ep. 02 - Soul Hunter
|
||||
: title: Babylon 5
|
||||
season: 1
|
||||
episode: 2
|
||||
episode_title: Soul Hunter
|
||||
type: episode
|
||||
|
||||
Reference in New Issue
Block a user