mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -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 {
|
||||
|
||||
// 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())),
|
||||
|
||||
|
@ -223,26 +223,33 @@ public class ReleaseInfo {
|
||||
// Windows / Linux / Mac system roots
|
||||
volumes.addAll(roots);
|
||||
|
||||
// Linux / Mac
|
||||
if (File.separator.equals("/")) {
|
||||
// Linux and Mac system root folders
|
||||
for (File root : roots) {
|
||||
volumes.addAll(getChildren(root, FOLDERS));
|
||||
}
|
||||
|
||||
if (isMacSandbox()) {
|
||||
// Mac
|
||||
for (File mediaRoot : getMediaRoots()) {
|
||||
volumes.addAll(getChildren(mediaRoot, FOLDERS));
|
||||
volumes.add(mediaRoot);
|
||||
}
|
||||
}
|
||||
|
||||
// Mac
|
||||
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)) {
|
||||
File sandbox = new File(System.getProperty("user.home"));
|
||||
|
||||
for (File userFolder : getChildren(sandbox, FOLDERS)) {
|
||||
volumes.add(new File(home, userFolder.getName()));
|
||||
}
|
||||
} else {
|
||||
// Linux / Mac
|
||||
if (!isWindowsApp()) {
|
||||
// Linux and Mac system root folders
|
||||
for (File root : roots) {
|
||||
volumes.addAll(getChildren(root, FOLDERS));
|
||||
}
|
||||
|
||||
for (File mediaRoot : getMediaRoots()) {
|
||||
volumes.addAll(getChildren(mediaRoot, FOLDERS));
|
||||
volumes.add(mediaRoot);
|
||||
}
|
||||
}
|
||||
|
||||
// Windows / Linux
|
||||
volumes.addAll(getChildren(home, FOLDERS));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user