Improved auto-detection for E01 style episodes

This commit is contained in:
Reinhard Pointner 2016-04-18 12:22:09 +00:00
parent 6e9ff01055
commit ce4293860f
1 changed files with 6 additions and 1 deletions

View File

@ -75,7 +75,8 @@ public class AutoDetection {
private static final Pattern SERIES_PATTERN = Pattern.compile("TV.Shows|TV.Series|Season.[0-9]+", CASE_INSENSITIVE);
private static final Pattern ANIME_PATTERN = Pattern.compile("Anime", CASE_INSENSITIVE);
private static final Pattern SERIES_EPISODE_PATTERN = Pattern.compile("^tv[sp]-", CASE_INSENSITIVE);
private static final Pattern EPISODE_PATTERN = Pattern.compile("E\\d{2,3}|EP\\d{1,3}", CASE_INSENSITIVE);
private static final Pattern SERIES_EPISODE_PATTERN = Pattern.compile("^tv[sp]\\p{Punct}", CASE_INSENSITIVE);
private static final Pattern ANIME_EPISODE_PATTERN = Pattern.compile("^\\[[^\\]]+Subs\\]", CASE_INSENSITIVE);
public boolean isMusic(File f) {
@ -95,6 +96,10 @@ public class AutoDetection {
return true;
}
if (find(f.getName(), EPISODE_PATTERN) && !isAnime(f)) {
return true;
}
Object metaInfo = xattr.getMetaInfo(f);
return metaInfo instanceof Episode && !AniDB.getIdentifier().equals(((Episode) metaInfo).getSeriesInfo().getDatabase());
}