diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-14 21:02:19 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-14 21:02:19 -0700 |
commit | d85a1113dc5d973713e205387fc7e8907c510d1a (patch) | |
tree | a98008e9978e761b55e70e26459f0748028f877e /src | |
parent | 9e5a86e13c44d2011460ddfe6e9de5f2ecba9934 (diff) | |
download | dsub-d85a1113dc5d973713e205387fc7e8907c510d1a.tar.gz dsub-d85a1113dc5d973713e205387fc7e8907c510d1a.tar.bz2 dsub-d85a1113dc5d973713e205387fc7e8907c510d1a.zip |
Fix deletePodcastEpisode not properly updating serialization
Diffstat (limited to 'src')
6 files changed, 12 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index bf9e5531..09a2e42b 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -1006,7 +1006,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter @Override
protected Void doInBackground() throws Throwable {
MusicService musicService = MusicServiceFactory.getMusicService(context);
- musicService.deletePodcastEpisode(episode.getEpisodeId(), context, null);
+ musicService.deletePodcastEpisode(episode.getEpisodeId(), episode.getParent(), null, context);
if (getDownloadService() != null) {
List<MusicDirectory.Entry> episodeList = new ArrayList<MusicDirectory.Entry>(1);
episodeList.add(episode);
@@ -1023,6 +1023,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter @Override
protected void error(Throwable error) {
+ Log.w(TAG, "Failed to delete podcast episode", error);
Util.toast(context, getErrorMessage(error), false);
}
}.execute();
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 5fe4a776..027f6694 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -718,17 +718,17 @@ public class CachedMusicService implements MusicService { } @Override - public void deletePodcastEpisode(final String id, Context context, ProgressListener progressListener) throws Exception{ - musicService.deletePodcastEpisode(id, context, progressListener); + public void deletePodcastEpisode(final String id, String parent, ProgressListener progressListener, Context context) throws Exception{ + musicService.deletePodcastEpisode(id, parent, progressListener, context); - new SerializeUpdater<PodcastEpisode>(context, "directory", "p-" + id) { + new MusicDirectoryUpdater(context, "directory", "p-" + parent) { @Override - public boolean checkResult(PodcastEpisode check) { - return id.equals(check.getId()); + public boolean checkResult(Entry check) { + return id.equals(((PodcastEpisode) check).getEpisodeId()); } @Override - public void updateResult(List<PodcastEpisode> objects, PodcastEpisode result) { + public void updateResult(List<Entry> objects, Entry result) { objects.remove(result); } }.execute(); diff --git a/src/github/daneren2005/dsub/service/MusicService.java b/src/github/daneren2005/dsub/service/MusicService.java index 78c99b73..f0751230 100644 --- a/src/github/daneren2005/dsub/service/MusicService.java +++ b/src/github/daneren2005/dsub/service/MusicService.java @@ -150,7 +150,7 @@ public interface MusicService { void downloadPodcastEpisode(String id, Context context, ProgressListener progressListener) throws Exception; - void deletePodcastEpisode(String id, Context context, ProgressListener progressListener) throws Exception; + void deletePodcastEpisode(String id, String parent, ProgressListener progressListener, Context context) throws Exception; void setRating(String id, int rating, Context context, ProgressListener progressListener) throws Exception; diff --git a/src/github/daneren2005/dsub/service/OfflineMusicService.java b/src/github/daneren2005/dsub/service/OfflineMusicService.java index 68906fd7..329bf5cd 100644 --- a/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -733,7 +733,7 @@ public class OfflineMusicService implements MusicService { } @Override - public void deletePodcastEpisode(String id, Context context, ProgressListener progressListener) throws Exception{ + public void deletePodcastEpisode(String id, String parent, ProgressListener progressListener, Context context) throws Exception{ throw new OfflineException(ERRORMSG); } diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index fe135dc6..52d0f877 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -1091,7 +1091,7 @@ public class RESTMusicService implements MusicService { } @Override - public void deletePodcastEpisode(String id, Context context, ProgressListener progressListener) throws Exception{ + public void deletePodcastEpisode(String id, String parent, ProgressListener progressListener, Context context) throws Exception{ checkServerVersion(context, "1.9", "Deleting podcasts not supported."); Reader reader = getReader(context, progressListener, "deletePodcastEpisode", null, "id", id); diff --git a/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java b/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java index 35d478d8..0ccac3a3 100644 --- a/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java +++ b/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java @@ -63,6 +63,7 @@ public class PodcastEntryParser extends AbstractParser { episode.setEpisodeId(get("id"));
episode.setId(get("streamId"));
episode.setTitle(get("title"));
+ episode.setParent(episodes.getId());
episode.setArtist(episodes.getName());
episode.setAlbum(get("description"));
episode.setDate(get("publishDate"));
|