mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Add multi-part videos to playback queue (#520)
## Description When playing media with multiple parts, the additional parts will be added to the playback queue. This means a multi-part movie or episode will be play all of the parts in order before the next item in the queue. This only affects the playback queue. There's no UI changes and no indication that a movie or episode has multiple parts. I'll work on that in a separate PR. ### Related issues Related to #455
This commit is contained in:
parent
6df89fe8c9
commit
925a4b9d82
3 changed files with 68 additions and 20 deletions
|
|
@ -418,3 +418,10 @@ fun rememberBackDropImage(item: BaseItem): String? {
|
|||
val imageUrlService = LocalImageUrlService.current
|
||||
return remember(item) { imageUrlService.getItemImageUrl(item, ImageType.BACKDROP) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this, coalescing nulls to zero, is greater than that
|
||||
*/
|
||||
fun Int?.gt(that: Int) = (this ?: 0) > that
|
||||
|
||||
fun Int?.lt(that: Int) = (this ?: 0) < that
|
||||
|
|
|
|||
|
|
@ -286,11 +286,12 @@ class PlaybackViewModel
|
|||
playNextUp()
|
||||
}
|
||||
|
||||
if (!isPlaylist && queriedItem.type == BaseItemKind.EPISODE) {
|
||||
val playlist =
|
||||
playlistCreator.createFromEpisode(queriedItem.seriesId!!, queriedItem.id)
|
||||
withContext(Dispatchers.Main) {
|
||||
this@PlaybackViewModel.playlist.value = playlist
|
||||
if (!isPlaylist) {
|
||||
val result = playlistCreator.createFrom(queriedItem)
|
||||
if (result is PlaylistCreationResult.Success && result.playlist.items.isNotEmpty()) {
|
||||
withContext(Dispatchers.Main) {
|
||||
this@PlaybackViewModel.playlist.value = result.playlist
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue