Save when its complete
This commit is contained in:
@@ -220,17 +220,24 @@ func (z *ZurgConfigV1) matchFilter(torrentName string, torrentSize int64, torren
|
||||
return false
|
||||
}
|
||||
if filter.HasEpisodes {
|
||||
regex := regexp.MustCompile(`(?i)s\d{2,3}.?e\d{2,3}`)
|
||||
if regex.MatchString(torrentName) {
|
||||
return true
|
||||
regexes := []*regexp.Regexp{
|
||||
regexp.MustCompile(`(?i)s\d\d\d?.?e\d\d\d?`),
|
||||
regexp.MustCompile(`(?i)seasons?\s?\d+`),
|
||||
regexp.MustCompile(`(?i)episodes?\s?\d+`),
|
||||
regexp.MustCompile(`(?i)[a-fA-F0-9]{8}`),
|
||||
}
|
||||
for _, filename := range fileNames {
|
||||
if regex.MatchString(filename) {
|
||||
for _, regex := range regexes {
|
||||
if regex.MatchString(torrentName) {
|
||||
return true
|
||||
}
|
||||
for _, filename := range fileNames {
|
||||
if regex.MatchString(filename) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
//remove resolution from filenames
|
||||
regex = regexp.MustCompile(`(?i)((720|1080|2160|480|360|240|144)[pi]|\d{3,4}x\d{3,4})`)
|
||||
regex := regexp.MustCompile(`(?i)((720|1080|2160|480|360|240|144)[pi]|\d{3,4}x\d{3,4})`)
|
||||
for i, filename := range fileNames {
|
||||
fileNames[i] = regex.ReplaceAllString(filename, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user