feat: show episode resource

This commit is contained in:
Simon Ding
2024-07-27 22:22:06 +08:00
parent feecc9f983
commit eae35ce862
21 changed files with 274 additions and 399 deletions

View File

@@ -112,25 +112,25 @@ func parseEnglishName(name string) *Metadata {
}
} else { //no episode, maybe like One Punch Man S2 - 08 [1080p].mkv
numRe := regexp.MustCompile(`^\d{1,2}$`)
for i, p := range newSplits {
if numRe.MatchString(p) {
if i > 0 && strings.Contains(newSplits[i-1], "season") { //last word cannot be season
continue
}
if i < seasonIndex {
//episode number most likely should comes alfter season number
continue
}
//episodeIndex = i
n, err := strconv.Atoi(p)
if err != nil {
panic(fmt.Sprintf("convert %s error: %v", p, err))
}
meta.Episode = n
// numRe := regexp.MustCompile(`^\d{1,2}$`)
// for i, p := range newSplits {
// if numRe.MatchString(p) {
// if i > 0 && strings.Contains(newSplits[i-1], "season") { //last word cannot be season
// continue
// }
// if i < seasonIndex {
// //episode number most likely should comes alfter season number
// continue
// }
// //episodeIndex = i
// n, err := strconv.Atoi(p)
// if err != nil {
// panic(fmt.Sprintf("convert %s error: %v", p, err))
// }
// meta.Episode = n
}
}
// }
// }
}
if resIndex != -1 {