Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

playback: rolling cache of streamed songs with a size limit

Aperta
#1,086 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Stack tecnologico
android, kotlin

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

enhancement

💬 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 CacheDataSource for downloads, so a second Media3 SimpleCache could sit between it and the network
  • Media3's LeastRecentlyUsedCacheEvictor evicts 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 custom CacheEvictor that 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di timusus/Shuttle2

Tutte le issue di timusus/Shuttle2

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.