mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 16:58: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 {
|
||||
Set<Integer> collection = new LinkedHashSet<Integer>();
|
||||
if (file.exists()) {
|
||||
for (File nfo : file.getParentFile().listFiles(NFO_FILES)) {
|
||||
String text = new String(readFile(nfo), "UTF-8");
|
||||
collection.addAll(grepImdbId(text));
|
||||
}
|
||||
List<File> nfoFiles = new ArrayList<File>();
|
||||
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");
|
||||
collection.addAll(grepImdbId(text));
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user