* special case for movie detection in folder-mode that should eliminate many possible (possible in folder mode anyway) false positives

This commit is contained in:
Reinhard Pointner 2012-10-22 12:49:12 +00:00
parent b638092409
commit 0b4b353912
1 changed files with 5 additions and 0 deletions

View File

@ -459,6 +459,11 @@ public class MediaDetection {
public static File guessMovieFolder(File movieFile) throws IOException { public static File guessMovieFolder(File movieFile) throws IOException {
// special case for folder mode
if (movieFile.isDirectory()) {
return movieFile;
}
// first meaningful parent folder (max 2 levels deep) // first meaningful parent folder (max 2 levels deep)
File f = movieFile.getParentFile(); File f = movieFile.getParentFile();
for (int i = 0; f != null && i < 2; f = f.getParentFile(), i++) { for (int i = 0; f != null && i < 2; f = f.getParentFile(), i++) {