mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
audio_service was initialized without a cache manager, so it made its own DefaultCacheManager: every web cover the notification or lock screen showed was downloaded again and stored again in the temporary directory, beside the copy the app's cover cache already held, and its memory never had the cover the player had just drawn, so the session first got the song without art and again after the download. MediaSessionArtCache resolves the app's cover cache on each call once it is ready, and the default cache before that, so a session that starts before the app shell (Android Auto) behaves as before. Awaiting CoverCacheManager.initialize() in the player init instead would race the app shell's own call and could create two managers over one cover index. The cover cache's byte budget deletes files its memory cache still lists, so a memory hit whose file is gone counts as a miss and the cover is fetched again instead of reaching the OS as a dead path. Test: with the app's cover already cached, the session's media item carries that file and the server sees one request, not two; after the file is deleted under the memory entry, the session fetches it again and gets a file that exists. Same bytes, same pixels.