fix: Android lock screen notification + radio mode + SW auto-update reliability
- Set mediaSession.playbackState='playing'/'paused' so Android keeps the notification alive when the screen sleeps - Provide 96x96/300x300/512x512 artwork sizes for Android notification views - playQueue() now calls fillRadioQueue() immediately when radio mode is on, so the infinite queue works without toggling radio off/on - SW: add GET_VERSION/VERSION message handler for version-query fallback - SW registration: updateViaCache:'none' prevents browser HTTP-caching sw.js - Bump cache to ns-v30 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0b9493c147
commit
dad2b0b730
2 files changed
+31
-20
No files matched your search
@@ -1,4 +1,4 @@
|
||||
const CACHE = 'ns-v29';
|
||||
const CACHE = 'ns-v30';
|
||||
const PRECACHE = ['/', 'index.html', 'styles.css', 'app.js', 'manifest.json', 'icon.svg'];
|
||||
const SKIP_PATHS = ['/rest/stream', '/rest/download', '/config.js'];
|
||||
|
||||
@@ -17,6 +17,12 @@ self.addEventListener('activate', e => {
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('message', e => {
|
||||
if (e.data?.type === 'GET_VERSION') {
|
||||
e.source.postMessage({ type: 'VERSION', version: CACHE });
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', e => {
|
||||
if (!e.request.url.startsWith(self.location.origin)) return;
|
||||
if (SKIP_PATHS.some(p => e.request.url.includes(p))) return;
|
||||
|
||||
Reference in new issue
Block a user