diff options
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java | 3 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java | 17 |
2 files changed, 8 insertions, 12 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java index 9369847e..c7d5f542 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadFile.java @@ -67,7 +67,7 @@ public class DownloadFile { saveFile = FileUtil.getSongFile(context, song); bitRate = Util.getMaxBitrate(context); partialFile = new File(saveFile.getParent(), FileUtil.getBaseName(saveFile.getName()) + - "." + bitRate + ".partial." + FileUtil.getExtension(saveFile.getName())); + ".partial." + FileUtil.getExtension(saveFile.getName())); completeFile = new File(saveFile.getParent(), FileUtil.getBaseName(saveFile.getName()) + ".complete." + FileUtil.getExtension(saveFile.getName())); mediaStoreService = new MediaStoreService(context); @@ -81,6 +81,7 @@ public class DownloadFile { * Returns the effective bit rate. */ public int getBitRate() { + bitRate = Util.getMaxBitrate(context); if (bitRate > 0) { return bitRate; } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java index 75ec6142..f9a6af99 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -70,17 +70,8 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; import github.daneren2005.dsub.R; -import github.daneren2005.dsub.domain.Indexes; -import github.daneren2005.dsub.domain.JukeboxStatus; -import github.daneren2005.dsub.domain.Lyrics; -import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.dsub.domain.*; import github.daneren2005.dsub.domain.MusicDirectory.Entry; -import github.daneren2005.dsub.domain.MusicFolder; -import github.daneren2005.dsub.domain.Playlist; -import github.daneren2005.dsub.domain.SearchCritera; -import github.daneren2005.dsub.domain.SearchResult; -import github.daneren2005.dsub.domain.ServerInfo; -import github.daneren2005.dsub.domain.Version; import github.daneren2005.dsub.service.parser.AlbumListParser; import github.daneren2005.dsub.service.parser.ErrorParser; import github.daneren2005.dsub.service.parser.IndexesParser; @@ -234,7 +225,11 @@ public class RESTMusicService implements MusicService { writeCachedIndexes(context, indexes, musicFolderId); return indexes; } - return cachedIndexes; + if(cachedIndexes != null) { + return cachedIndexes; + } else { + return new Indexes(0, new ArrayList<Artist>(), new ArrayList<Artist>()); + } } finally { Util.close(reader); } |