Improve pattern recognition by removing noise
This commit is contained in:
@@ -229,6 +229,26 @@ func (z *ZurgConfigV1) matchFilter(torrentName string, torrentSize int64, torren
|
||||
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})`)
|
||||
for i, filename := range fileNames {
|
||||
fileNames[i] = regex.ReplaceAllString(filename, "")
|
||||
}
|
||||
// remove year from filenames
|
||||
regex = regexp.MustCompile(`(19\d|20[0-2])\d`)
|
||||
for i, filename := range fileNames {
|
||||
fileNames[i] = regex.ReplaceAllString(filename, "")
|
||||
}
|
||||
// remove filenames with "extras" in name
|
||||
regex = regexp.MustCompile(`(?i)extras`)
|
||||
for i, filename := range fileNames {
|
||||
if regex.MatchString(filename) {
|
||||
fileNames[i] = ""
|
||||
}
|
||||
}
|
||||
if strings.Contains(torrentName, "Hellraiser") {
|
||||
fmt.Printf("+%v\n", fileNames)
|
||||
}
|
||||
return checkArithmeticSequenceInFilenames(fileNames)
|
||||
}
|
||||
if filter.FileInsideSizeGreaterThanOrEqual > 0 {
|
||||
|
||||
Reference in New Issue
Block a user