修复: 播放器series logo获取改为独立LaunchedEffect

- 将series logo获取拆分为独立的LaunchedEffect
- 先加载episode item,再异步获取series logo
- 避免在同一个LaunchedEffect中修改state导致重组问题

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
beyondandClaude Opus 5 committed 2026-09-06 18:24:13 +08:00
1 parent fdf14f7dd2
commit d7726424d9
1 file changed
+10 -6
@@ -438,19 +438,23 @@ private fun PlayerDestination(
} catch (_: Exception) { } catch (_: Exception) {
null null
} }
// If episode has no logo, fetch the series item to get its logo itemLoading = false
val currentSeriesId = seriesId ?: item?.seriesId }
if (item?.logoImageTag == null && !currentSeriesId.isNullOrBlank() && server != null && server.apiKey.isNotBlank()) {
// Fetch series logo if episode has no logo
val currentSeriesId = seriesId ?: item?.seriesId
LaunchedEffect(server?.id, currentSeriesId, item?.id) {
if (item != null && item!!.logoImageTag == null && !currentSeriesId.isNullOrBlank() && server != null && server.apiKey.isNotBlank()) {
try { try {
val seriesItem = EmbyRepository.getItem(server, currentSeriesId) val seriesItem = EmbyRepository.getItem(server, currentSeriesId)
if (seriesItem?.logoImageTag != null) { if (seriesItem?.logoImageTag != null) {
item = item?.copy( val updated = item!!.copy(
imageTags = (item?.imageTags ?: emptyMap()) + mapOf("Logo" to seriesItem.logoImageTag!!) imageTags = (item!!.imageTags ?: emptyMap()) + mapOf("Logo" to seriesItem.logoImageTag!!)
) )
item = updated
} }
} catch (_: Exception) { /* ignore */ } } catch (_: Exception) { /* ignore */ }
} }
itemLoading = false
} }
val effectiveSeriesId = seriesId ?: item?.seriesId val effectiveSeriesId = seriesId ?: item?.seriesId