diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-09-24 15:47:12 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-09-24 15:47:12 -0700 |
commit | 5d1e48e94101ceea3ccbb012a40f1eb63b29067b (patch) | |
tree | 23da625f42a3161e9576e536961a49ecbf1eee16 /src/github/daneren2005 | |
parent | c574e4c968f11d2c33e932444a557bd0cb3ce865 (diff) | |
download | dsub-5d1e48e94101ceea3ccbb012a40f1eb63b29067b.tar.gz dsub-5d1e48e94101ceea3ccbb012a40f1eb63b29067b.tar.bz2 dsub-5d1e48e94101ceea3ccbb012a40f1eb63b29067b.zip |
Remove MusicFolder serialization from RESTMusicService
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/service/RESTMusicService.java | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index 947f89e2..6c9dc5ba 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -186,17 +186,9 @@ public class RESTMusicService implements MusicService { } public List<MusicFolder> getMusicFolders(boolean refresh, Context context, ProgressListener progressListener) throws Exception { - - List<MusicFolder> cachedMusicFolders = readCachedMusicFolders(context); - if (cachedMusicFolders != null && !refresh) { - return cachedMusicFolders; - } - Reader reader = getReader(context, progressListener, "getMusicFolders", null); try { - List<MusicFolder> musicFolders = new MusicFoldersParser(context).parse(reader, progressListener); - writeCachedMusicFolders(context, musicFolders); - return musicFolders; + return new MusicFoldersParser(context).parse(reader, progressListener); } finally { Util.close(reader); } @@ -256,21 +248,6 @@ public class RESTMusicService implements MusicService { return "indexes-" + Math.abs(s.hashCode()) + ".ser"; } - private ArrayList<MusicFolder> readCachedMusicFolders(Context context) { - String filename = getCachedMusicFoldersFilename(context); - return FileUtil.deserialize(context, filename, ArrayList.class); - } - - private void writeCachedMusicFolders(Context context, List<MusicFolder> musicFolders) { - String filename = getCachedMusicFoldersFilename(context); - FileUtil.serialize(context, new ArrayList<MusicFolder>(musicFolders), filename); - } - - private String getCachedMusicFoldersFilename(Context context) { - String s = Util.getRestUrl(context, null); - return "musicFolders-" + Math.abs(s.hashCode()) + ".ser"; - } - @Override public MusicDirectory getMusicDirectory(String id, String name, boolean refresh, Context context, ProgressListener progressListener) throws Exception { SharedPreferences prefs = Util.getPreferences(context); |