mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-24 03:36:51 +00:00
feat(jellyfin): add ETag-based conditional HTTP caching for home refresh
Introduce an OkHttp interceptor that caches ETags from home-refresh endpoints and throws NotModifiedException on 304, allowing callers to reuse cached data. Wire it into the Jellyfin SDK via a dedicated @JellyfinSdkClient OkHttpClient. Update API methods to return null on 304, and update InMemoryAppContentRepository to keep existing state when null is returned. Persist dateLastMediaAdded from /UserViews in HomeCache to short-circuit unchanged /Items/Latest calls.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package hu.bbara.purefin.core.jellyfin
|
||||
|
||||
import javax.inject.Qualifier
|
||||
|
||||
/**
|
||||
* Marks an `OkHttpClient` that is wired into the Jellyfin SDK's `OkHttpFactory`.
|
||||
* Distinct from the unqualified client used for image loading and media streaming
|
||||
* because the SDK has its own auth path and the ETag interceptor should not leak
|
||||
* into non-SDK HTTP calls.
|
||||
*/
|
||||
@Qualifier
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class JellyfinSdkClient
|
||||
Reference in New Issue
Block a user