Fix resuming streamed content (#257)
* Fix resuming streamed content * Remove debug log statement
This commit is contained in:
parent
e899a977ab
commit
776ba29e69
2 changed files with 3 additions and 3 deletions
|
@ -94,7 +94,7 @@ fun loadDownloadedEpisodes(downloadDatabase: DownloadDatabaseDao): List<PlayerIt
|
|||
name = it.name,
|
||||
itemId = it.id,
|
||||
mediaSourceId = "",
|
||||
playbackPosition = it.playbackPosition ?: 0,
|
||||
playbackPosition = it.playbackPosition?.div(10000) ?: 0,
|
||||
mediaSourceUri = File(defaultStorage, it.id.toString()).absolutePath,
|
||||
parentIndexNumber = it.parentIndexNumber,
|
||||
indexNumber = it.indexNumber,
|
||||
|
@ -134,7 +134,7 @@ fun getDownloadPlayerItem(downloadDatabase: DownloadDatabaseDao, itemId: UUID):
|
|||
metadata.name,
|
||||
UUID.fromString(file.name),
|
||||
"",
|
||||
metadata.playbackPosition!!,
|
||||
metadata.playbackPosition!!.div(10000),
|
||||
file.absolutePath,
|
||||
metadata.parentIndexNumber,
|
||||
metadata.indexNumber,
|
||||
|
|
|
@ -151,7 +151,7 @@ constructor(
|
|||
Timber.e(e)
|
||||
}
|
||||
|
||||
player.setMediaItems(mediaItems, currentMediaItemIndex, items.getOrNull(currentMediaItemIndex)?.playbackPosition?.div(10000) ?: C.TIME_UNSET)
|
||||
player.setMediaItems(mediaItems, currentMediaItemIndex, items.getOrNull(currentMediaItemIndex)?.playbackPosition?: C.TIME_UNSET)
|
||||
if (appPreferences.playerMpv && playFromDownloads) { // For some reason, adding a 1ms delay between these two lines fixes a crash when playing with mpv from downloads
|
||||
withContext(Dispatchers.IO) {
|
||||
Thread.sleep(1)
|
||||
|
|
Loading…
Reference in a new issue