mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-05 00:45:06 -05:00
* more deep movie folder guessing
This commit is contained in:
parent
883c684bac
commit
df12a4dda9
@ -532,8 +532,16 @@ public class MediaDetection {
|
||||
}
|
||||
}
|
||||
|
||||
// first meaningful parent folder (max 2 levels deep)
|
||||
// first parent folder that matches a movie (max 3 levels deep)
|
||||
File f = movieFile.getParentFile();
|
||||
for (int i = 0; f != null && i < 3; f = f.getParentFile(), i++) {
|
||||
String term = stripReleaseInfo(f.getName());
|
||||
if (term.length() > 0 && checkMovie(f) != null) {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise try the first potentially meaningful parent folder (max 2 levels deep)
|
||||
for (int i = 0; f != null && i < 2; f = f.getParentFile(), i++) {
|
||||
String term = stripReleaseInfo(f.getName());
|
||||
if (term.length() > 0) {
|
||||
@ -551,7 +559,7 @@ public class MediaDetection {
|
||||
|
||||
|
||||
public static Movie checkMovie(File file) throws Exception {
|
||||
List<Movie> matches = file != null ? matchMovieName(singleton(file.getName()), false, 0) : null;
|
||||
List<Movie> matches = file != null ? matchMovieName(singleton(file.getName()), false, 2) : null;
|
||||
return matches != null && matches.size() > 0 ? matches.get(0) : null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user