fix: episode match

This commit is contained in:
Simon Ding
2024-11-15 13:12:20 +08:00
parent 58428405b0
commit c433ccaa0e
2 changed files with 12 additions and 1 deletions

View File

@@ -217,7 +217,7 @@ func findEpisodes(s string) (start int, end int) {
if maybeSeasonPack(s) { //avoid miss match, season pack not use this rule
return -1, -1
}
re3 := regexp.MustCompile(`[^\d\w]\d{1,2}[^\d\w]`)
re3 := regexp.MustCompile(`[^(season)][^\d\w]\d{1,2}[^\d\w]`)
epNums := re3.FindAllString(s, -1)
if len(epNums) > 0 {

View File

@@ -196,3 +196,14 @@ func Test_ParseTV18(t *testing.T) {
//assert.Equal(t, false, m.IsSeasonPack)
//assert.Equal(t, "720p", m.Resolution)
}
// The Day of the Jackal (Season 1) WEB-DL 1080p
func Test_ParseTV19(t *testing.T) {
s1 := "The Day of the Jackal (Season 1) WEB-DL 1080p "
m := ParseTv(s1)
log.Infof("results: %+v", m)
assert.Equal(t, 1, m.Season)
assert.Equal(t, true, m.IsSeasonPack)
//assert.Equal(t, "720p", m.Resolution)
}