Skip to content

Commit

Permalink
[engine] ctx.source: keep search result group
Browse files Browse the repository at this point in the history
  • Loading branch information
NextFire committed Jan 28, 2024
1 parent a38cafa commit 300d6cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sachi/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ def get_context(self) -> FilebotContext:
return ctx

def analyze_filename(self, ctx: FilebotContext) -> FilebotContext:
for k, v in SOURCES_RE.items():
if v.search(self.path.name):
ctx.source = k
for reg in SOURCES_RE.values():
search = reg.search(self.path.name)
if search is not None:
ctx.source = search.group(0)
break
return ctx

Expand Down

0 comments on commit 300d6cf

Please sign in to comment.