Fix several playback issues (#240)

Fixes issues introduced in #222:
- Switching tracks
- Downloading subtitles
- Trickplay
This commit is contained in:
damontecres 2025-11-17 22:08:26 -05:00 committed by GitHub
parent 037e846599
commit 90956bd0e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -244,8 +244,10 @@ class PlaybackViewModel
) )
return@withContext false return@withContext false
} }
val isLiveTv = item.type == BaseItemKind.TV_CHANNEL this@PlaybackViewModel.item = item
this@PlaybackViewModel.itemId = item.id
val isLiveTv = item.type == BaseItemKind.TV_CHANNEL
val base = item.data val base = item.data
val title = val title =
if (base.type == BaseItemKind.EPISODE) { if (base.type == BaseItemKind.EPISODE) {
@ -980,7 +982,7 @@ class PlaybackViewModel
delay(1500) delay(1500)
item = item =
BaseItem.from( BaseItem.from(
api.userLibraryApi.getItem(itemId = item.id).content, api.userLibraryApi.getItem(itemId = it.itemId).content,
api, api,
) )
val mediaSource = chooseSource(item.data, it) val mediaSource = chooseSource(item.data, it)