This commit is contained in:
Simon Ding
2024-08-02 12:19:53 +08:00
parent 7f8c613a65
commit 3aeecac4fb
3 changed files with 27 additions and 15 deletions

17
pkg/metadata/doc.go Normal file
View File

@@ -0,0 +1,17 @@
package metadata
/*
tv name examples
Cowboy Cartel S01E02 XviD-AFG [eztv]
The.Bold.and.the.Beautiful.S37E219.XviD-AFG
As Husband As Wife 2024 S01E05-E06 1080p WEB-DL HEVC DDP 2Audios-QHstudIo
Twinkle Love 2024 S04 Complete 2160p WEB-DL HEVC AAC-QHstudIo
One Punch Man S2 - 08 [1080p].mkv
[千夏字幕组][小市民系列_Shoushimin Series][第03话][1080p_HEVC][简繁内封][招募新人]
[OPFans楓雪動漫][ONE PIECE 海賊王][第1113話][周日版][1080p][MP4][簡體]
[桜都字幕组] 亦叶亦花 / Nanare Hananare [04][1080p][简体内嵌]
[ANi] 戰國妖狐 千魔混沌篇 - 16 [1080P][Baha][WEB-DL][AAC AVC][CHT][MP4]
[ANi] 這是妳與我的最後戰場,或是開創世界的聖戰 第二季 - 04 [1080P][Baha][WEB-DL][AAC AVC][CHT][MP4]
*/

10
pkg/metadata/tv_test.go Normal file
View File

@@ -0,0 +1,10 @@
package metadata
var tvEnNames = []string{
"As Husband As Wife 2024 S01E05-E06 1080p WEB-DL HEVC DDP 2Audios-QHstudIo",
"Twinkle Love 2024 S04 Complete 2160p WEB-DL HEVC AAC-QHstudIo",
}
var tvCnNames = []string{
}

View File

@@ -112,21 +112,6 @@ func FindSeasonPackageInfo(name string) (se int, err error) {
return se, err
}
func IsSeasonPackageName(name string) bool {
seRe := regexp.MustCompile(`S\d+`)
epRe := regexp.MustCompile(`E\d+`)
nameUpper := strings.ToUpper(name)
matchEp := epRe.FindAllString(nameUpper, -1)
if len(matchEp) != 0 {
return false //episode number should not exist
}
matchSe := seRe.FindAllString(nameUpper, -1)
if len(matchSe) == 0 {
return false //no season num
}
return true
}
func ContainsIgnoreCase(s, substr string) bool {
return strings.Contains(strings.ToLower(s), strings.ToLower(substr))
}