1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-04 16:35:08 -05:00

* improve subtitle/nfo matching here as well

This commit is contained in:
Reinhard Pointner 2012-07-25 20:45:58 +00:00
parent 7cc54fc59e
commit faea58b7c7

View File

@ -517,11 +517,11 @@ public class MediaBindingBean {
if (SUBTITLE_FILES.accept(mediaFile) || getDefaultFilter("application/nfo").accept(mediaFile)) {
// file is a subtitle
String baseName = stripReleaseInfo(FileUtilities.getName(mediaFile).toLowerCase());
String baseName = stripReleaseInfo(FileUtilities.getName(mediaFile)).toLowerCase();
// find corresponding movie file
for (File movieFile : mediaFile.getParentFile().listFiles(VIDEO_FILES)) {
if (baseName.startsWith(stripReleaseInfo(FileUtilities.getName(movieFile)).toLowerCase())) {
if (stripReleaseInfo(FileUtilities.getName(movieFile)).toLowerCase().startsWith(baseName)) {
return movieFile;
}
}