From 414aa33b3cb2621b4808b596e264ce8d4090384f Mon Sep 17 00:00:00 2001 From: soup Date: Wed, 5 Nov 2025 21:32:37 +0100 Subject: [PATCH] fix(parser): map MAX releases to collection --- lex.go | 8 +++++++- taginfo/taginfo.csv | 1 + tests.yaml | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lex.go b/lex.go index 2601117..8f71d68 100644 --- a/lex.go +++ b/lex.go @@ -568,6 +568,12 @@ func NewGenreLexer() Lexer { } } +// groupShortTagAllow permits certain short tags to still be parsed as release +// groups even if they also exist in taginfo (eg, MAX). +var groupShortTagAllow = map[string]bool{ + "MAX": true, +} + // NewGroupLexer creates a tag lexer for a group. func NewGroupLexer() Lexer { const delim, invalid = '-', ` _.()[]{}+` @@ -608,7 +614,7 @@ func NewGroupLexer() Lexer { s := src[l+j+1 : n] if grp := bytes.Trim(s, " \t_"); len(grp) != 0 && (!bytes.ContainsAny(s, invalid) || (len(s) <= 14 && group.Match(grp))) && - !shortTags[string(grp)] && + (!shortTags[string(grp)] || groupShortTagAllow[string(grp)]) && (len(end) == 0 || !bracket.MatchString(end[len(end)-1].Text())) { return start, append( end, diff --git a/taginfo/taginfo.csv b/taginfo/taginfo.csv index 3ed2246..b79540c 100644 --- a/taginfo/taginfo.csv +++ b/taginfo/taginfo.csv @@ -138,6 +138,7 @@ collection,LearnNowOnline,,,,education,1 collection,LinkedIn.Learning,LinkedIn Learning,linkedin[\-\._ ]?learning,,education,1 collection,LinuxCBT,,linux[\-\._ ]?cbt(?:[\-\._ ]?com)?,,education,1 collection,Lynda,,lynda(?:[\-\._ ]?com)?,,education,1 +collection,MAX,Max,(?-i:MAX),,, collection,MTV,MTV Networks,,,, collection,MUBI,Mubi,,,, collection,NBC,National Broadcasting Company,,,, diff --git a/tests.yaml b/tests.yaml index 9a54456..5aa3ca2 100644 --- a/tests.yaml +++ b/tests.yaml @@ -1903,6 +1903,18 @@ other: "BOXSET" language: "NORDiC" group: "TWASERiES" +"Game of Thrones S01 1080p MAX WEB-DL DD+ 5.1 Atmos DV HDR H.265-Kitsune": + type: "series" + title: "Game of Thrones" + source: "WEB-DL" + resolution: "1080p" + collection: "MAX" + series: 1 + codec: "H.265" + hdr: "DV HDR" + audio: "DDP Atmos" + channels: "5.1" + group: "Kitsune" "Game of Thrones - 4x03 - Breaker of Chains": type: "episode" title: "Game of Thrones"