PlaybackService now adds completed items to the playbackhistory

This commit is contained in:
daniel oeh 2012-10-03 15:05:30 +02:00
parent 0b5fa1c612
commit b76ab8053c
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package de.danoeh.antennapod.service;
import java.io.IOException;
import java.util.Date;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ScheduledFuture;
@ -653,11 +654,13 @@ public class PlaybackService extends Service {
// Save state
cancelPositionSaver();
media.setPosition(0);
media.setPlaybackCompletionDate(new Date());
manager.markItemRead(PlaybackService.this, media.getItem(), true);
boolean isInQueue = manager.isInQueue(media.getItem());
if (isInQueue) {
manager.removeQueueItem(PlaybackService.this, media.getItem());
}
manager.addItemToPlaybackHistory(PlaybackService.this, media.getItem());
manager.setFeedMedia(PlaybackService.this, media);
long autoDeleteMediaId = media.getId();