mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
FAIL *facepalm*
This commit is contained in:
parent
9ab1f33ed1
commit
bd8b67422e
@ -318,24 +318,26 @@ public final class FileUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getName(File file) {
|
public static String getName(File file) {
|
||||||
if (file == null)
|
if (file == null) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (file.isDirectory())
|
if (file.isDirectory() || file.getName().isEmpty() || UNC_PREFIX.equals(file.getParent())) {
|
||||||
return file.getName();
|
|
||||||
|
|
||||||
if (file.getName().isEmpty() || UNC_PREFIX.equals(file.getParent()))
|
|
||||||
return getFolderName(file);
|
return getFolderName(file);
|
||||||
|
}
|
||||||
|
|
||||||
return getNameWithoutExtension(file.getName());
|
return getNameWithoutExtension(file.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFolderName(File file) {
|
public static String getFolderName(File file) {
|
||||||
if (UNC_PREFIX.equals(file.getParent()))
|
if (UNC_PREFIX.equals(file.getParent())) {
|
||||||
return file.toString();
|
return file.toString();
|
||||||
|
}
|
||||||
|
|
||||||
if (file.getName().length() > 0)
|
String name = file.getName();
|
||||||
return file.getName();
|
if (name.length() > 0) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
// file might be a drive (only has a path, but no name)
|
// file might be a drive (only has a path, but no name)
|
||||||
return replacePathSeparators(file.toString(), "");
|
return replacePathSeparators(file.toString(), "");
|
||||||
|
Loading…
Reference in New Issue
Block a user