mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-10 06:20:27 -04:00
Avoid directory listing of folders that can't accessible due to the sandbox anyway
This commit is contained in:
parent
75d0e86e8c
commit
75a5cc55af
@ -14,7 +14,7 @@ import java.util.logging.Level;
|
|||||||
public enum ApplicationFolder {
|
public enum ApplicationFolder {
|
||||||
|
|
||||||
// real user home (the user.home will point to the application-specific container in sandbox environments)
|
// real user home (the user.home will point to the application-specific container in sandbox environments)
|
||||||
UserHome(isMacSandbox() ? System.getProperty("UserHome") : System.getProperty("user.home")),
|
UserHome(System.getProperty(isMacSandbox() ? "UserHome" : "user.home")),
|
||||||
|
|
||||||
AppData(System.getProperty("application.dir", UserHome.resolve(".filebot").getPath())),
|
AppData(System.getProperty("application.dir", UserHome.resolve(".filebot").getPath())),
|
||||||
|
|
||||||
|
@ -223,8 +223,21 @@ public class ReleaseInfo {
|
|||||||
// Windows / Linux / Mac system roots
|
// Windows / Linux / Mac system roots
|
||||||
volumes.addAll(roots);
|
volumes.addAll(roots);
|
||||||
|
|
||||||
|
if (isMacSandbox()) {
|
||||||
|
// Mac
|
||||||
|
for (File mediaRoot : getMediaRoots()) {
|
||||||
|
volumes.add(mediaRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
// e.g. ignore default Movie folder (user.home and real user home are different in the sandbox environment)
|
||||||
|
File sandbox = new File(System.getProperty("user.home"));
|
||||||
|
|
||||||
|
for (File userFolder : getChildren(sandbox, FOLDERS)) {
|
||||||
|
volumes.add(new File(home, userFolder.getName()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// Linux / Mac
|
// Linux / Mac
|
||||||
if (File.separator.equals("/")) {
|
if (!isWindowsApp()) {
|
||||||
// Linux and Mac system root folders
|
// Linux and Mac system root folders
|
||||||
for (File root : roots) {
|
for (File root : roots) {
|
||||||
volumes.addAll(getChildren(root, FOLDERS));
|
volumes.addAll(getChildren(root, FOLDERS));
|
||||||
@ -236,13 +249,7 @@ public class ReleaseInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mac
|
// Windows / Linux
|
||||||
if (isMacSandbox()) {
|
|
||||||
// e.g. ignore default Movie folder (user.home and real user home are different in the sandbox environment)
|
|
||||||
for (File userFolder : getChildren(new File(System.getProperty("user.home")), FOLDERS)) {
|
|
||||||
volumes.add(new File(home, userFolder.getName()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
volumes.addAll(getChildren(home, FOLDERS));
|
volumes.addAll(getChildren(home, FOLDERS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user