66from collections import defaultdict
77
88from rebulk import Rebulk , Rule , AppendMatch , RemoveMatch , RenameMatch , POST_PROCESS
9+ from rebulk .rebulk import Matches
910
1011from ..common import seps , title_seps
1112from ..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 ,
0 commit comments