Skip to content

Commit 78deaba

Browse files
committed
Enable Filepart2EpisodeTitle rule with absolute episodes
1 parent d3b06fa commit 78deaba

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

guessit/rules/properties/episode_title.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from collections import defaultdict
77

88
from rebulk import Rebulk, Rule, AppendMatch, RemoveMatch, RenameMatch, POST_PROCESS
9+
from rebulk.rebulk import Matches
910

1011
from ..common import seps, title_seps
1112
from ..common.formatters import cleanup
@@ -272,6 +273,9 @@ class Filepart2EpisodeTitle(Rule):
272273
273274
If BBBB contains season and episode and AAA contains a hole
274275
then title is to be found in AAAA.
276+
277+
If BBBB contais the episode and no season is found (absolute numbering)
278+
then title is to be found in AAAA.
275279
"""
276280
consequence = AppendMatch('title')
277281

@@ -290,7 +294,7 @@ def when(self, matches, context): # pylint:disable=inconsistent-return-statemen
290294
if episode_number:
291295
season = (matches.range(directory.start, directory.end, lambda match: match.name == 'season', 0) or
292296
matches.range(filename.start, filename.end, lambda match: match.name == 'season', 0))
293-
if season:
297+
if season or not matches.named("season"):
294298
hole = matches.holes(directory.start, directory.end,
295299
ignore=or_(lambda match: 'weak-episode' in match.tags, TitleBaseRule.is_ignored),
296300
formatter=cleanup, seps=title_seps,

guessit/test/episodes.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4770,3 +4770,10 @@
47704770
video_codec: H.264
47714771
release_group: NOGRP
47724772
type: episode
4773+
4774+
? video/zettai karen children/01 - Absolutely Lovely! Their Name Is The Children.mkv
4775+
: title: "zettai karen children"
4776+
episode: 1
4777+
episode_title: "Absolutely Lovely! Their Name Is The Children"
4778+
container: mkv
4779+
type: episode

0 commit comments

Comments
 (0)