Do not reset played duration of completed episode; restore statistics for old behavior
This commit is contained in:
parent
6cebc0c276
commit
fd05940d67
|
@ -949,8 +949,12 @@ public final class DBReader {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// played duration used to be reset when the item is added to the playback history
|
||||||
|
if(media.getPlaybackCompletionDate() != null) {
|
||||||
|
feedPlayedTime += media.getDuration() / 1000;
|
||||||
|
}
|
||||||
feedPlayedTime += media.getPlayedDuration() / 1000;
|
feedPlayedTime += media.getPlayedDuration() / 1000;
|
||||||
if(media.getPlayedDuration() > 0) {
|
if (media.getPlaybackCompletionDate() != null || media.getPlayedDuration() > 0) {
|
||||||
episodesStarted++;
|
episodesStarted++;
|
||||||
}
|
}
|
||||||
feedTotalTime += media.getDuration() / 1000;
|
feedTotalTime += media.getDuration() / 1000;
|
||||||
|
|
|
@ -272,8 +272,6 @@ public class DBWriter {
|
||||||
return dbExec.submit(() -> {
|
return dbExec.submit(() -> {
|
||||||
Log.d(TAG, "Adding new item to playback history");
|
Log.d(TAG, "Adding new item to playback history");
|
||||||
media.setPlaybackCompletionDate(new Date());
|
media.setPlaybackCompletionDate(new Date());
|
||||||
// reset played_duration to 0 so that it behaves correctly when the episode is played again
|
|
||||||
media.setPlayedDuration(0);
|
|
||||||
|
|
||||||
PodDBAdapter adapter = PodDBAdapter.getInstance();
|
PodDBAdapter adapter = PodDBAdapter.getInstance();
|
||||||
adapter.open();
|
adapter.open();
|
||||||
|
|
Loading…
Reference in New Issue