Save playback state even if stream is finished and add isFinished()
This commit is contained in:
parent
e846f69e38
commit
360f5ac6f7
4 changed files with 38 additions and 13 deletions
|
|
@ -215,7 +215,7 @@ public class HistoryRecordManager {
|
|||
.flatMapPublisher(streamStateTable::getState)
|
||||
.firstElement()
|
||||
.flatMap(list -> list.isEmpty() ? Maybe.empty() : Maybe.just(list.get(0)))
|
||||
.filter(state -> state.isValid((int) queueItem.getDuration()))
|
||||
.filter(StreamStateEntity::isValid)
|
||||
.subscribeOn(Schedulers.io());
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ public class HistoryRecordManager {
|
|||
.flatMapPublisher(streamStateTable::getState)
|
||||
.firstElement()
|
||||
.flatMap(list -> list.isEmpty() ? Maybe.empty() : Maybe.just(list.get(0)))
|
||||
.filter(state -> state.isValid((int) info.getDuration()))
|
||||
.filter(StreamStateEntity::isValid)
|
||||
.subscribeOn(Schedulers.io());
|
||||
}
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ public class HistoryRecordManager {
|
|||
return Completable.fromAction(() -> database.runInTransaction(() -> {
|
||||
final long streamId = streamTable.upsert(new StreamEntity(info));
|
||||
final StreamStateEntity state = new StreamStateEntity(streamId, progressTime);
|
||||
if (state.isValid((int) info.getDuration())) {
|
||||
if (state.isValid()) {
|
||||
streamStateTable.upsert(state);
|
||||
} else {
|
||||
streamStateTable.deleteState(streamId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue