Files
NovaSonic/src/state.js
T
HoneyandClaude Sonnet 4.6 89e169b70a fix: prevent notification close on skip and background audio stall
- playCurrent: set _trackChanging flag and update media session metadata
  before changing src, so the pause event fired by src-swap does not
  set playbackState='paused' and dismiss the Samsung cover screen notification
- Remove stalled->load() handler that silently paused audio with no recovery
- Error handler now retries regardless of paused state (load() causes paused)
- Add .catch() to audio.play() in playCurrent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 20:23:51 +02:00

70 lines
1.2 KiB
JavaScript

// Shared mutable state — imported as { S } in every module
export const S = {
cfg: { url: '', user: '', pass: '', lastfmKey: '', backendUrl: '' },
// Playback
queue: [],
qIdx: -1,
shuffle: false,
repeat: false,
radioMode: false,
audio: null,
previewAudio: null,
previewCurrent: null,
_scrubbing: false,
_msPosLast: 0,
_trackChanging: false,
queueOpen: false,
// Now Playing overlay
npOpen: false,
npQueueMode: false,
npLyricsMode: false,
// Navigation history
_navStack: [],
_navCursor: -1,
_navJumping: false,
// Search
searchTimer: null,
globalSearchTimer: null,
_mobileSearchTimer: null,
// Download
downloadTarget: null,
dlType: 'track',
jobs: {},
// Playlists
_currentPlaylist: null,
plModalSongs: [],
cachedPlaylists: [],
// Navidrome REST auth
_ndToken: null,
// Artist images cache
artistImgCache: {},
// Audiobookshelf
abs: {
url: '', token: null, userId: null,
currentLibraryId: null,
},
absPlayer: {
open: false,
item: null,
_sessionId: null,
audioTracks: [],
trackIdx: 0,
chapters: [],
chapterIdx: -1,
playing: false,
currentTime: 0,
duration: 0,
speed: 1.0,
sleepRemaining: null,
},
};