From e0bb32cbd0eea7b81d2124e617497301b47fc274 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 10 Aug 2014 14:47:47 +0000 Subject: [PATCH] * refactoring --- source/net/filebot/media/ReleaseInfo.java | 21 ++++++++----------- .../net/filebot/media/ReleaseInfo.properties | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/source/net/filebot/media/ReleaseInfo.java b/source/net/filebot/media/ReleaseInfo.java index 16896060..9c99e51f 100644 --- a/source/net/filebot/media/ReleaseInfo.java +++ b/source/net/filebot/media/ReleaseInfo.java @@ -202,25 +202,22 @@ public class ReleaseInfo { volumes.addAll(getChildren(root, FOLDERS)); } - // add additional user roots if user.home is not set properly - String username = System.getProperty("user.name"); - if (username != null && username.length() > 0) { - volumes.add(new File("/Users/" + username)); - volumes.add(new File("/home/" + username)); - volumes.add(new File("/media/" + username)); - } - // user-specific media roots - for (File root : getMediaRoots()) { - if (root.isDirectory()) { - volumes.addAll(getChildren(root, FOLDERS)); + for (File mediaRoot : getMediaRoots()) { + volumes.addAll(getChildren(mediaRoot, FOLDERS)); + volumes.add(mediaRoot); + + // add additional user roots if user.home is not set properly or listFiles doesn't work + String username = System.getProperty("user.name"); + if (username != null && username.length() > 0) { + volumes.add(new File(mediaRoot, username)); } - volumes.add(root); } } volumeRoots = unmodifiableSet(volumes); } + System.out.println(volumeRoots); return volumeRoots; } diff --git a/source/net/filebot/media/ReleaseInfo.properties b/source/net/filebot/media/ReleaseInfo.properties index 8d58c70a..b72a84f1 100644 --- a/source/net/filebot/media/ReleaseInfo.properties +++ b/source/net/filebot/media/ReleaseInfo.properties @@ -35,4 +35,4 @@ url.anidb-index: http://app.filebot.net/data/anidb.txt.xz pattern.diskfolder.entry: BDMV|HVDVD_TS|VIDEO_TS|AUDIO_TS|VCD|MovieObject.bdmv|VIDEO_TS.VOB|movie.nfo # media root folders -folder.media.roots: /Volumes:/home:/mnt:/media \ No newline at end of file +folder.media.roots: /Volumes:/Users:/home:/mnt:/media \ No newline at end of file