aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-07-09 21:37:17 -0700
committerScott Jackson <daneren2005@gmail.com>2013-07-09 21:37:17 -0700
commita3649fb9eb64602fc676a9ec3b93733e631dab13 (patch)
tree57546343ce039508c6982dade300a4a0e4a748b4 /subsonic-android
parent94747c900f2968484af3288e4a48ce082dbce6ba (diff)
downloaddsub-a3649fb9eb64602fc676a9ec3b93733e631dab13.tar.gz
dsub-a3649fb9eb64602fc676a9ec3b93733e631dab13.tar.bz2
dsub-a3649fb9eb64602fc676a9ec3b93733e631dab13.zip
Only show server header in offline mode playlist names if playlists from other servers are actually cached
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
index f72f83c4..3bb30bc1 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
@@ -52,6 +52,7 @@ import github.daneren2005.dsub.util.ProgressListener;
import github.daneren2005.dsub.util.Util;
import java.io.*;
import java.util.Comparator;
+import java.util.SortedSet;
/**
* @author Sindre Mehus
@@ -366,7 +367,8 @@ public class OfflineMusicService extends RESTMusicService {
for (File folder : FileUtil.listFiles(root)) {
if(folder.isDirectory()) {
String server = folder.getName();
- for(File file: FileUtil.listFiles(folder)) {
+ SortedSet<File> fileList = FileUtil.listFiles(folder);
+ for(File file: fileList) {
if(FileUtil.isPlaylistFile(file)) {
String id = file.getName();
String filename = server + ": " + FileUtil.getBaseName(id);
@@ -375,7 +377,7 @@ public class OfflineMusicService extends RESTMusicService {
}
}
- if(!server.equals(lastServer)) {
+ if(!server.equals(lastServer) && fileList.size() > 0) {
if(lastServer != null) {
removeServer = false;
}