Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '-', ` _.()[]{}+`
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions taginfo/taginfo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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,,,,
Expand Down
12 changes: 12 additions & 0 deletions tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down