diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/PlayerScreen.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/PlayerScreen.kt index 81c52ea4..5376fc00 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/PlayerScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/PlayerScreen.kt @@ -1488,6 +1488,14 @@ fun PlayerScreen( errorMessage = message if (message != null) { controlsVisible = !playerControlsLocked + val currentVideoId = activeVideoId + if (currentVideoId != null) { + val cacheKey = StreamLinkCacheRepository.contentKey( + contentType ?: parentMetaType, + currentVideoId, + ) + StreamLinkCacheRepository.remove(cacheKey) + } } }, ) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/streams/StreamLinkCacheRepository.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/streams/StreamLinkCacheRepository.kt index 07519fd7..0d497166 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/streams/StreamLinkCacheRepository.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/streams/StreamLinkCacheRepository.kt @@ -53,6 +53,10 @@ object StreamLinkCacheRepository { StreamLinkCacheStorage.saveEntry(hashedKey(contentKey), payload) } + fun remove(contentKey: String) { + StreamLinkCacheStorage.removeEntry(hashedKey(contentKey)) + } + fun getValid(contentKey: String, maxAgeMs: Long): CachedStreamLink? { if (maxAgeMs <= 0L) return null val raw = StreamLinkCacheStorage.loadEntry(hashedKey(contentKey)) ?: return null