diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-09-24 21:27:24 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-09-24 21:27:24 -0700 |
commit | 6f489bf69237b70bf211eb8c694a7a3f6427f067 (patch) | |
tree | 877eb2ec53a2b003cd0b04fbcd7b0b1b648b28df /src/github/daneren2005 | |
parent | 79224d8ea3aa18154bd45d91c4a12ac2127bcb98 (diff) | |
download | dsub-6f489bf69237b70bf211eb8c694a7a3f6427f067.tar.gz dsub-6f489bf69237b70bf211eb8c694a7a3f6427f067.tar.bz2 dsub-6f489bf69237b70bf211eb8c694a7a3f6427f067.zip |
Fix web commit
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/domain/Playlist.java | 3 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 18 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/github/daneren2005/dsub/domain/Playlist.java b/src/github/daneren2005/dsub/domain/Playlist.java index c97659c7..663fa2b0 100644 --- a/src/github/daneren2005/dsub/domain/Playlist.java +++ b/src/github/daneren2005/dsub/domain/Playlist.java @@ -33,6 +33,9 @@ public class Playlist implements Serializable { private String created; private Boolean pub; + public Playlist() { + + } public Playlist(String id, String name) { this.id = id; this.name = name; diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index f48ad337..4b17d2c8 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -18,6 +18,8 @@ */ package github.daneren2005.dsub.service; +import java.io.File; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -94,12 +96,12 @@ public class CachedMusicService implements MusicService { List<MusicFolder> result = cachedMusicFolders.get(); if (result == null) { if(!refresh) { - result = FileUtil.deserialize(context, getCacheName(context, "musicFolders"), List.class); + result = FileUtil.deserialize(context, getCacheName(context, "musicFolders"), ArrayList.class); } if(result == null) { result = musicService.getMusicFolders(refresh, context, progressListener); - FileUtil.serialize(context, result, getCacheName(context, "musicFolders")); + FileUtil.serialize(context, new ArrayList<MusicFolder>(result), getCacheName(context, "musicFolders")); } cachedMusicFolders.set(result); } @@ -164,7 +166,7 @@ public class CachedMusicService implements MusicService { if(result == null) { result = musicService.getPlaylists(refresh, context, progressListener); - FileUtil.serialize(context, result, getCacheName(context, "playlist")); + FileUtil.serialize(context, new ArrayList<Playlist>(result), getCacheName(context, "playlist")); } cachedPlaylists.set(result); } @@ -174,7 +176,7 @@ public class CachedMusicService implements MusicService { @Override public void createPlaylist(String id, String name, List<MusicDirectory.Entry> entries, Context context, ProgressListener progressListener) throws Exception { cachedPlaylists.clear(); - Util.delete(new File(context.getCacheDir(), getCacheName(context, "playlist")); + Util.delete(new File(context.getCacheDir(), getCacheName(context, "playlist"))); musicService.createPlaylist(id, name, entries, context, progressListener); } @@ -321,12 +323,12 @@ public class CachedMusicService implements MusicService { if (result == null) { if(!refresh) { - result = FileUtil.deserialize(context, getCacheName(context, "genre"), List.class); + result = FileUtil.deserialize(context, getCacheName(context, "genre"), ArrayList.class); } if(result == null) { result = musicService.getGenres(refresh, context, progressListener); - FileUtil.serialize(context, result, getCacheName(context, "genre")); + FileUtil.serialize(context, new ArrayList<Genre>(result), getCacheName(context, "genre")); } cachedGenres.set(result); } @@ -346,12 +348,12 @@ public class CachedMusicService implements MusicService { if (result == null) { if(!refresh) { - result = FileUtil.deserialize(context, getCacheName(context, "podcast"), List.class); + result = FileUtil.deserialize(context, getCacheName(context, "podcast"), ArrayList.class); } if(result == null) { result = musicService.getPodcastChannels(refresh, context, progressListener); - FileUtil.serialize(context, result, getCacheName(context, "podcast")); + FileUtil.serialize(context, new ArrayList<PodcastChannel>(result), getCacheName(context, "podcast")); } cachedPodcastChannels.set(result); } |