Skip to content

Commit 07093dd

Browse files
EstrellaXDclaude
andcommitted
fix(parser): handle torrent names without brackets in get_group
Fixes IndexError when parsing torrent names that don't follow the standard [Group] format. Now returns empty string instead of crashing. Fixes #973 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 99c8764 commit 07093dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backend/src/module/parser/analyser/raw_parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030

3131

3232
def get_group(name: str) -> str:
33-
return re.split(r"[\[\]]", name)[1]
33+
parts = re.split(r"[\[\]]", name)
34+
if len(parts) > 1:
35+
return parts[1]
36+
return ""
3437

3538

3639
def pre_process(raw_name: str) -> str:

0 commit comments

Comments
 (0)