diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-06-27 18:09:51 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-06-27 18:09:51 -0400 |
commit | 51e3f55561c5d34a51de1543028f12635acb6de9 (patch) | |
tree | 30a03d2ac4f8219c24a5fd6c4defe71fc922346c /app | |
parent | 5d553394ba3f204435be78f3a77262a579bd40d5 (diff) | |
download | AntennaPod-51e3f55561c5d34a51de1543028f12635acb6de9.zip |
Don't send Gpodder actions for items that don't have media.
Fixes AntennaPod/AntennaPod#964
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java | 13 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java | 19 |
2 files changed, 11 insertions, 21 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java index 223fe17f6..4d6279560 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java @@ -97,19 +97,6 @@ public class DefaultActionButtonCallback implements ActionButtonCallback { } else { if (!item.isRead()) { DBWriter.markItemRead(context, item, true, true); - - if(GpodnetPreferences.loggedIn()) { - // gpodder: send played action - FeedMedia media = item.getMedia(); - GpodnetEpisodeAction action = new GpodnetEpisodeAction.Builder(item, GpodnetEpisodeAction.Action.PLAY) - .currentDeviceId() - .currentTimestamp() - .started(media.getDuration() / 1000) - .position(media.getDuration() / 1000) - .total(media.getDuration() / 1000) - .build(); - GpodnetPreferences.enqueueEpisodeAction(action); - } } } } diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java index c33ab93b4..e3285fd53 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -158,14 +158,17 @@ public class FeedItemMenuHandler { DBWriter.markItemRead(context, selectedItem, true, false); if(GpodnetPreferences.loggedIn()) { FeedMedia media = selectedItem.getMedia(); - GpodnetEpisodeAction actionPlay = new GpodnetEpisodeAction.Builder(selectedItem, Action.PLAY) - .currentDeviceId() - .currentTimestamp() - .started(media.getDuration() / 1000) - .position(media.getDuration() / 1000) - .total(media.getDuration() / 1000) - .build(); - GpodnetPreferences.enqueueEpisodeAction(actionPlay); + // not all items have media, Gpodder only cares about those that do + if (media != null) { + GpodnetEpisodeAction actionPlay = new GpodnetEpisodeAction.Builder(selectedItem, Action.PLAY) + .currentDeviceId() + .currentTimestamp() + .started(media.getDuration() / 1000) + .position(media.getDuration() / 1000) + .total(media.getDuration() / 1000) + .build(); + GpodnetPreferences.enqueueEpisodeAction(actionPlay); + } } break; case R.id.mark_unread_item: |