playback: rolling cache of streamed songs with a size limit
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- audio-video-rtc, mobile
Direzione di ricerca
Start by reading the playback path that uses CacheDataSource and the existing download cache, then check how playback events identify a song ending normally. The design notes point to Media3 SimpleCache, HLS streams, and cache eviction by whole song, but do not name source files or tests. Done means fully played streamed songs can be kept within a size limit, evicted by last-played time, and made available offline without affecting manual downloads.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
💬 User story
As a user streaming from Jellyfin
I want songs I played in full to stay cached on the device automatically, up to a size limit I choose
So that my regularly played music works offline without having to download songs or albums by hand
📝 Notes
- Size limit with presets like 5 / 10 / 25 / 50 / 100 GB, plus a custom value and "off" – with lossless files, small limits only hold a few hundred songs
- A safeguard that always leaves some storage free (e.g. 2 GB), so a large limit can't fill the phone
- Only songs played in full get cached; skipped or partly played songs aren't kept
- Songs streamed transcoded (e.g. the 320 kbps default on mobile data) are cached at that quality; ideally they're replaced by the original file later when on Wi-Fi, or there's an option to only cache original-quality streams
- When the cache is full, the songs played least recently are removed first (by last played, not by when they were cached); optionally, favourited songs are never removed
- Separate from Downloads: manual downloads are never evicted and don't count against the limit
- Offline mode treats cached songs like downloads, so they stay listed and playable instead of being hidden
- Cached songs also play in Android Auto without a connection
- Lives under Settings > Sources > Streaming & downloads, next to Downloads; the Downloads screen could show the cache's storage use next to downloads, with its own "clear cache" action
👩🔧 Technical Design Notes
- Playback already goes through a
CacheDataSourcefor downloads, so a second Media3SimpleCachecould sit between it and the network - Media3's
LeastRecentlyUsedCacheEvictorevicts per span (~5 MB chunks) and by last access, which can leave half-evicted songs that take up space but can't play offline; a customCacheEvictorthat tracks size and last-played time per song could remove whole songs instead - Use a stable cache key per song (song ID, not the URL with the token), so a rotated token doesn't make cached songs miss
- Transcoded streams are AAC in HLS segments on Android, so the cache key and the "fully cached" check need to cover HLS as well as direct file streams
- "Played in full" fits the existing playback events: keep a song once it ends normally, and drop partial copies
🤝 Relationships
- #498 – offline mode should count cached songs as available, like downloads
- #989 – the planned "Downloaded" filter should include cached songs too, ideally as one shared "available offline" definition
- Lingua principale
- Kotlin
- Stelle
- 232
- Fork
- 28
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di timusus/Shuttle2
-
design
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement impact:U2 P3 reach:R1 size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug impact:U1 P3 reach:R2 size:S
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
-
bug impact:U2 P2 reach:R2 size:M
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
design
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di timusus/Shuttle2
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
OpenAPITools/openapi-generator#25454 ·
I maintainer di solito rispondono entro 1 giorno
-
Broken links in the docsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
googleads/googleads-mobile-android-mediation#1675 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
navikt/mock-oauth2-server#1149 ·
I maintainer di solito rispondono entro 1 giorno
-
triaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno