mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-06 15:10:49 +08:00
fix: episode match
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user