Updated nyaa.si filename format parsing

This commit is contained in:
Kenneth Jao 2025-05-01 14:29:02 -04:00
parent 672826979c
commit 528b9ea82b

21
main.go
View File

@ -229,7 +229,7 @@ func GetAllAvailable(name string, onlyHEVC bool) ([]Anime, error) {
return return
}*/ }*/
isHEVC := strings.Contains(title, "[HEVC]") isHEVC := strings.Contains(title, "HEVC")
if onlyHEVC && !isHEVC { if onlyHEVC && !isHEVC {
return return
} }
@ -240,16 +240,17 @@ func GetAllAvailable(name string, onlyHEVC bool) ([]Anime, error) {
} else if strings.Contains(title, "(Repack)") { } else if strings.Contains(title, "(Repack)") {
title = strings.Split(title, " (Repack)")[0] title = strings.Split(title, " (Repack)")[0]
} else { } else {
is720 := strings.Contains(title, "[720p]") title = strings.Split(title, " [")[0]
is1080 := strings.Contains(title, "[1080p]") // is720 := strings.Contains(title, "[720p]")
// is1080 := strings.Contains(title, "[1080p]")
if is720 { // if is720 {
title = strings.Split(title, " [720p]")[0] // title = strings.Split(title, " [720p]")[0]
} else if is1080 { // } else if is1080 {
title = strings.Split(title, " [1080p]")[0] // title = strings.Split(title, " [1080p]")[0]
} else { // } else {
e.Log(fmt.Sprintf("Episode not found, or processed incorrectly. Got: %s.", title), LogNTFY()) // e.Log(fmt.Sprintf("Episode not found, or processed incorrectly. Got: %s.", title), LogNTFY())
} // }
} }