Deprecate url.exclude-blacklist # clutter file exclude pattern

This commit is contained in:
Reinhard Pointner 2017-02-27 23:08:50 +08:00
parent f28e41626f
commit 7eb59a9c62
3 changed files with 12 additions and 18 deletions

View File

@ -81,12 +81,7 @@ public class MediaDetection {
} }
public static FileFilter getClutterFileFilter() { public static FileFilter getClutterFileFilter() {
try {
return releaseInfo.getClutterFileFilter(); return releaseInfo.getClutterFileFilter();
} catch (Exception e) {
debug.log(Level.SEVERE, "Failed to load clutter file filter: " + e.getMessage(), e);
}
return f -> false;
} }
public static boolean isDiskFolder(File folder) { public static boolean isDiskFolder(File folder) {

View File

@ -318,6 +318,10 @@ public class ReleaseInfo {
return compileWordPattern(getProperty("pattern.video.repack")); return compileWordPattern(getProperty("pattern.video.repack"));
} }
public Pattern getExcludePattern() {
return compileWordPattern(getProperty("pattern.clutter.excludes"));
}
public Pattern getClutterBracketPattern(boolean strict) { public Pattern getClutterBracketPattern(boolean strict) {
// match patterns like [Action, Drama] or {ENG-XViD-MP3-DVDRiP} etc // match patterns like [Action, Drama] or {ENG-XViD-MP3-DVDRiP} etc
String brackets = "()[]{}"; String brackets = "()[]{}";
@ -350,10 +354,6 @@ public class ReleaseInfo {
return compileWordPattern(queryBlacklist.get()); // pattern matching any release group name enclosed in separators return compileWordPattern(queryBlacklist.get()); // pattern matching any release group name enclosed in separators
} }
public Pattern getExcludePattern() throws Exception {
return compile(or(excludeBlacklist.get()), CASE_INSENSITIVE);
}
private Pattern compileWordPattern(String[] patterns) { private Pattern compileWordPattern(String[] patterns) {
return compile("(?<!\\p{Alnum})" + or(patterns) + "(?!\\p{Alnum})", CASE_INSENSITIVE); // use | to join patterns return compile("(?<!\\p{Alnum})" + or(patterns) + "(?!\\p{Alnum})", CASE_INSENSITIVE); // use | to join patterns
} }
@ -402,7 +402,7 @@ public class ReleaseInfo {
private static ClutterFileFilter clutterFileFilter; private static ClutterFileFilter clutterFileFilter;
public FileFilter getClutterFileFilter() throws Exception { public FileFilter getClutterFileFilter() {
if (clutterFileFilter == null) { if (clutterFileFilter == null) {
clutterFileFilter = new ClutterFileFilter(getExcludePattern(), Long.parseLong(getProperty("number.clutter.maxfilesize"))); // only files smaller than 250 MB may be considered clutter clutterFileFilter = new ClutterFileFilter(getExcludePattern(), Long.parseLong(getProperty("number.clutter.maxfilesize"))); // only files smaller than 250 MB may be considered clutter
} }
@ -439,7 +439,6 @@ public class ReleaseInfo {
private final Resource<String[]> releaseGroup = lines("url.release-groups", Cache.ONE_WEEK); private final Resource<String[]> releaseGroup = lines("url.release-groups", Cache.ONE_WEEK);
private final Resource<String[]> queryBlacklist = lines("url.query-blacklist", Cache.ONE_WEEK); private final Resource<String[]> queryBlacklist = lines("url.query-blacklist", Cache.ONE_WEEK);
private final Resource<String[]> excludeBlacklist = lines("url.exclude-blacklist", Cache.ONE_WEEK);
private final Resource<SearchResult[]> tvdbIndex = tsv("url.thetvdb-index", Cache.ONE_WEEK, this::parseSeries, SearchResult[]::new); private final Resource<SearchResult[]> tvdbIndex = tsv("url.thetvdb-index", Cache.ONE_WEEK, this::parseSeries, SearchResult[]::new);
private final Resource<SearchResult[]> anidbIndex = tsv("url.anidb-index", Cache.ONE_WEEK, this::parseSeries, SearchResult[]::new); private final Resource<SearchResult[]> anidbIndex = tsv("url.anidb-index", Cache.ONE_WEEK, this::parseSeries, SearchResult[]::new);

View File

@ -16,18 +16,18 @@ pattern.subtitle.tags: forced|HI|SDH
# additional release info patterns # additional release info patterns
pattern.video.format: DivX|Xvid|AVC|(x|h)[.]?(264|265)|HEVC|3ivx|PGS|MP[E]?G[45]?|MP[34]|(FLAC|AAC|AC3|DD|MA).?[2457][.]?[01]|[26]ch|(Multi.)?DTS(.HD)?(.MA)?|FLAC|AAC|AC3|TrueHD|Atmos|[M0]?(720|1080)[pi]|(?<=[-])(720|1080|2D|3D)|10.?bit|(24|30|60)FPS|Hi10[P]?|[a-z]{2,3}.(2[.]0|5[.]1)|(19|20)[0-9]+(.)S[0-9]+(?!(.)?E[0-9]+)|(?<=\\d+)v[0-4]|CD\\d+ pattern.video.format: DivX|Xvid|AVC|(x|h)[.]?(264|265)|HEVC|3ivx|PGS|MP[E]?G[45]?|MP[34]|(FLAC|AAC|AC3|DD|MA).?[2457][.]?[01]|[26]ch|(Multi.)?DTS(.HD)?(.MA)?|FLAC|AAC|AC3|TrueHD|Atmos|[M0]?(720|1080)[pi]|(?<=[-])(720|1080|2D|3D)|10.?bit|(24|30|60)FPS|Hi10[P]?|[a-z]{2,3}.(2[.]0|5[.]1)|(19|20)[0-9]+(.)S[0-9]+(?!(.)?E[0-9]+)|(?<=\\d+)v[0-4]|CD\\d+
# clutter file exclude pattern
pattern.clutter.excludes: (?<=[!-\\(\\[])(Sample|Trailer)|(Sample|Trailer)(?=[-.\\)\\]])|(NCED|NCOP|(OP|ED)\\p{Digit}\\p{Alpha})|(Extras|Trailers|Featurettes|Interviews|Scenes|Shorts)$|Behind.the.Scenes|Deleted.and.Extended.Scenes|Deleted.Scenes
# only files smaller than 250 MB may be considered clutter
number.clutter.maxfilesize: 262144000
# known release group names # known release group names
url.release-groups: https://app.filebot.net/data/release-groups.txt.xz url.release-groups: https://app.filebot.net/data/release-groups.txt.xz
# blacklisted terms that will be ignored # blacklisted terms that will be ignored
url.query-blacklist: https://app.filebot.net/data/query-blacklist.txt.xz url.query-blacklist: https://app.filebot.net/data/query-blacklist.txt.xz
# clutter files that will be ignored
url.exclude-blacklist: https://app.filebot.net/data/exclude-blacklist.txt.xz
# only files smaller than 250 MB may be considered clutter
number.clutter.maxfilesize: 262144000
# list of patterns directly matching files to series names # list of patterns directly matching files to series names
url.series-mappings: https://app.filebot.net/data/series-mappings.txt.xz url.series-mappings: https://app.filebot.net/data/series-mappings.txt.xz