mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-25 09:18:51 -05:00
* 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()) {
|
||||||
String text = new String(readFile(nfo), "UTF-8");
|
nfoFiles.addAll(listFiles(singleton(file), 10, false));
|
||||||
collection.addAll(grepImdbId(text));
|
} 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");
|
||||||
|
collection.addAll(grepImdbId(text));
|
||||||
|
}
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user