summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/danoeh/antennapod/adapter
diff options
context:
space:
mode:
authorMartin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de>2015-04-18 12:16:45 +0200
committerMartin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de>2015-04-18 12:44:43 +0200
commit1bb1f0990f6b9fb6b30383083aa592fd40c4c72e (patch)
tree4116ea882052ab0b722d18ba9dd2d77fb1fdf14b /app/src/main/java/de/danoeh/antennapod/adapter
parentbf7e7d897bae3f58acaed76897359041bd620936 (diff)
parent001013ae9e0da2dea4bc7b04d4b83c90c55950e9 (diff)
downloadAntennaPod-1bb1f0990f6b9fb6b30383083aa592fd40c4c72e.zip
Prepare merge.
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java15
1 files changed, 15 insertions, 0 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 14644dd68..d3843934a 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java
@@ -11,6 +11,8 @@ import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
+import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction;
+import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.DownloadRequestException;
@@ -61,6 +63,19 @@ 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);
+ }
}
}
}