* support parsing .nfo from video folders
This commit is contained in:
parent
9ac886f214
commit
165c66a319
|
@ -566,12 +566,19 @@ public class MediaDetection {
|
||||||
|
|
||||||
public static Set<Integer> grepImdbIdFor(File file) throws Exception {
|
public static Set<Integer> grepImdbIdFor(File file) throws Exception {
|
||||||
Set<Integer> collection = new LinkedHashSet<Integer>();
|
Set<Integer> collection = new LinkedHashSet<Integer>();
|
||||||
if (file.exists()) {
|
List<File> nfoFiles = new ArrayList<File>();
|
||||||
for (File nfo : file.getParentFile().listFiles(NFO_FILES)) {
|
if (file.isDirectory()) {
|
||||||
|
nfoFiles.addAll(listFiles(singleton(file), 10, false));
|
||||||
|
} else {
|
||||||
|
addAll(nfoFiles, file.getParentFile().listFiles(NFO_FILES));
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse ids from nfo files
|
||||||
|
for (File nfo : nfoFiles) {
|
||||||
String text = new String(readFile(nfo), "UTF-8");
|
String text = new String(readFile(nfo), "UTF-8");
|
||||||
collection.addAll(grepImdbId(text));
|
collection.addAll(grepImdbId(text));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue