Fix preview/formatting issues with String objects that are paths and not just filenames

@see https://www.filebot.net/forums/viewtopic.php?f=5&t=4500
This commit is contained in:
Reinhard Pointner 2016-12-15 00:18:38 +08:00
parent e7a4140426
commit a56f4d25ad
1 changed files with 2 additions and 2 deletions

View File

@ -32,11 +32,11 @@ class FileNameFormatter implements MatchFormatter {
if (value instanceof FileInfo) {
FileInfo file = (FileInfo) value;
return extension ? file.getPath() : file.getName();
return extension ? file.toFile().getName() : file.getName();
}
if (value instanceof String) {
return extension ? value.toString() : getNameWithoutExtension(new File(value.toString()).getName());
return extension ? value.toString() : getNameWithoutExtension(value.toString());
}
// cannot format value