* connect nfo files to video files as well just like subtitles to make media info bindings match

This commit is contained in:
Reinhard Pointner 2012-07-21 15:54:39 +00:00
parent 425902f15d
commit 20ed98147f
1 changed files with 6 additions and 6 deletions

View File

@ -485,14 +485,14 @@ public class MediaBindingBean {
// make sure media file is defined
checkMediaFile();
if (SUBTITLE_FILES.accept(mediaFile)) {
if (SUBTITLE_FILES.accept(mediaFile) || getDefaultFilter("application/nfo").accept(mediaFile)) {
// file is a subtitle
String name = FileUtilities.getName(mediaFile).toLowerCase();
String baseName = stripReleaseInfo(FileUtilities.getName(mediaFile).toLowerCase());
// find corresponding movie file
for (File movie : mediaFile.getParentFile().listFiles(VIDEO_FILES)) {
if (name.startsWith(FileUtilities.getName(movie).toLowerCase())) {
return movie;
for (File movieFile : mediaFile.getParentFile().listFiles(VIDEO_FILES)) {
if (baseName.startsWith(stripReleaseInfo(FileUtilities.getName(movieFile)).toLowerCase())) {
return movieFile;
}
}
}
@ -523,7 +523,7 @@ public class MediaBindingBean {
mediaInfo = newMediaInfo;
}
return (MediaInfo) mediaInfo;
return mediaInfo;
}