Commit graph

16 commits

Author SHA1 Message Date
99bf17ec1a Fix 3 crashes from crash logs: SmartDJCache race, AVPlayer observer, KVO threading
🔴 SmartDJCache concurrent Dictionary crash (April 27+28 crash logs):
- EXC_BAD_ACCESS + doesNotRecognizeSelector in bulkImport()
- memoryCache dictionary mutated from main thread (loadBulkCache)
  and background Task.detached (bulkImport) simultaneously
- Fix: NSLock serializes all memoryCache reads and writes

🔴 stopAVPlayer removeTimeObserver crash (April 30 crash log):
- SIGABRT in -[AVPlayer removeTimeObserver:] from Previous button
- timeObserver registered on old player, self.player swapped to
  crossfade's active player by finalizeCrossfade
- Fix: remove observer from OLD player at both swap sites before
  assignment + reorder stopAVPlayer (observer before replaceCurrentItem)

🟡 Audit fixes (no crash logs, preventative):
- KVO in radioSeekBack wrapped in DispatchQueue.main.async
- Stale vis Task guarded by songId in all MainActor.run blocks
- CHANGELOG.md with full findings documentation
2026-04-30 17:27:54 -07:00
fba2da4700 UI scaling on scrollabile windows 2026-04-17 09:58:05 -07:00
72c622ab44 quick fix 2026-04-14 12:59:22 -07:00
53b15aac27 Add edit history, discover, queue sync, share links
- Edit History: full timeline UI with revert capability, accessible from Issues & Conflicts
- Batch Undo: inline undo button in BatchAlbumEditorSheet + MultiAlbumEditorSheet
- Companion API: 7 bug fixes (audio.delete data loss, path-key backup, AIFF support,
  restructure backup, manifest context, double-undo prevention, single-track history)
- Recently Played: new tab between Recently Added and Favourites
- Discover: random albums scroll, shuffle all, genre quick-play chips on home tab
- Play Queue Sync: auto-saves to server, cross-device resume banner on launch
- Share Links: create + copy + share via sheet in Get Info
- Models: PlayQueue, ShareItem, EditHistoryEntry, UndoResult
- SubsonicClient: savePlayQueue, getPlayQueue, createShare endpoints
2026-04-14 11:35:52 -07:00
Dallas Groot
b9844b23cd Performance audit, Now Playing widget, crossfade stability, cover art embedding, DJ profile bulk cache
PERFORMANCE AUDIT
- Removed 16 dead SubsonicClient methods (~117 lines)
- Added NSCache memory tier to LibraryCache, AlbumCoverStore,
ArtistCoverStore, RadioCoverStore
- Replaced weak polynomial hash with FNV-1a 64-bit in ImageCache
- Split PlaybackStateStore into save() (full queue) and savePosition()
(time only)
- Reused single SubsonicClient in OfflineManager instead of
per-download allocation
- Added periodic ImageCache disk trim every 50 writes
- Changed AudioPreFetcher to fuzzy offline match
(isSongAvailableOffline)
- Removed dead code: hasCompanionLibrary, downloadedSongIds, isActive,
CachedImageLoader.task
- Fixed thread safety: inline JSONEncoder/JSONDecoder in LibraryCache
(no shared instances)

WIDGET EXTENSION (new target: NavidromeWidget)
- v2 glassmorphism design: blurred album art background + frosted
glass panel
- Waveform scrubber: 40-bar Canvas with tap-to-seek (20 segments via
SeekToIntent)
- Color-adaptive theming: CIAreaAverage dominant color extraction with
HSB contrast adjustment
- Transport controls: previous/play-pause/next with interactive
AppIntents
- Up Next footer with crossfade countdown from Smart DJ profiles
- Large widget: 3-item queue list with numbered rows
- Small/Medium/Large sizes matching design mockups
- App Group communication via WidgetSharedState (UserDefaults)
- Darwin notification observer for widget→app commands
- Foreground command pickup for suspended app recovery
- Idempotency guards on all widget commands

CROSSFADE & PLAYBACK FIXES
- Fixed dual audio on single-song queue: guard nextSong.id ==
currentSong?.id in prepareNextForCrossfade
- Fixed crossfade play path never calling pushWidgetState (returned
before reaching it)
- Fixed crossfade needsNextTrack callback missing queue persistence +
widget push
- Fixed toggleShuffle queue not persisted after PlaybackStateStore
split
- Added nowPlayingSyncTimer restart on foreground (Lock Screen seek
bar drift)
- Added AVPlayer currentTime/duration sync in resumeVisTimers before
vis timer restart
(fixes waveform distortion after background — confirmed by Apple
Forums + SoundCloud engineering)

COVER ART PIPELINE
- Fixed pushWidgetState cover art size mismatch (300→600 to match
fetchAndSetArtwork)
- Added custom cover art key differentiation ("custom_" prefix forces
re-blur)
- Changed server art lookup from memoryOnlyImage to cachedImage
(memory+disk fallback)
- Added POST /library/cover-art-by-path endpoint (was missing — iOS
fallback hit 404)
- Added navidrome_id fallback on existing cover art endpoint
- Added embed_cover_art_in_file/embed_cover_art_in_directory: mutagen
writes cover art
directly into FLAC/MP3/M4A/OGG metadata tags so Navidrome serves
updated art
- All three upload paths (by-id, by-path, upload-tracks) now embed +
trigger_scan

COMPANION API FIXES
- Fixed _create_task recursion (was calling itself instead of
asyncio.create_task)
- Fixed navidrome_db NameError on /library/conflicts endpoint
- Reduced WebSocket connect/disconnect logging (only first-client and
all-disconnected)

SMART DJ PROFILE PREFETCH
- New endpoint: GET /smart-dj/profiles/export (bulk JSON, gzip
automatic)
- SmartDJCache.loadBulkCache() reads single file on launch (instant)
- SmartDJCache.bulkImport() writes all profiles in one atomic file
- CompanionAPIService.fetchAllProfiles() fetches entire profile set in
one request
- Wired into NavidromePlayerApp.task after server connect
- SmartCrossfadeManager unchanged — already reads from SmartDJCache
first

WEBSOCKET NOISE REDUCTION
- iOS: silent reconnect retries, only log milestones (#1, #5, every
20th)
- iOS: log "reconnected after N attempts" on success, silent initial
connect
- Python: only log first client connect and all-clients-disconnected

Files: 13 modified, 8 new (including companion-api/main.py)
2026-04-12 19:24:22 -07:00
Dallas Groot
aa97be4caa batch albumart fix 2026-04-12 18:07:12 -07:00
Dallas Groot
85c85c2090 memory improvements 2026-04-11 15:37:14 -07:00
Dallas Groot
2f65da3ccc quick fix
Companion (main.py):
	•	NAVIDROME_TAGS whitelist — the single source of truth for what tags
survive
	•	enforce_tag_whitelist() — whitelist enforcer, replaces blacklist
approach
	•	All 5 write points updated: apply_tags, apply_tags_dict,
upload-track, upload-tracks, restructure_all
	•	preserve_composer and preserve_lyrics flags on both upload
endpoints (default False)
	•	/library/clean-tags now uses whitelist enforcer
iOS:
	•	UploadMetadata — preserveComposer and preserveLyrics fields
	•	buildMultipartBody — sends both flags as form fields
	•	BatchUploadView — two toggles, both off by default, wired end-to-end
	•	MultiAlbumEditorSheet — full rewrite matching
BatchAlbumEditorSheet: MusicBrainz search, swipe to exclude/include
tracks, Reset button, cover art widget with red glow
2026-04-11 09:40:51 -07:00
Dallas Groot
d32d63a749 batch updated with cover art support 2026-04-11 08:07:55 -07:00
Dallas Groot
db9d79f023 safeguards to id3 tagging and mismatch info 2026-04-11 01:36:13 -07:00
Dallas Groot
f761f65e87 edit-metadata endpoint
iOS — 6 fixes across 5 files:
Models.swift — Song, Album, AlbumWithSongs all now have albumArtist:
String?. CompanionSong.toSong() passes albumArtist.
CompanionAlbum.toAlbum() passes albumArtist to the new field.
TrackEditorView.swift — Album Artist field now initialises from
song.albumArtist ?? song.artist instead of just song.artist.
fetchCompanionDetails no longer requires companion: prefix — it
fetches for all songs using the album name, decodes properly using
CompanionLibraryResponse, and matches by relative_path.
BatchAlbumEditorSheet.swift — initialises from album.albumArtist ??
album.artist.
MultiAlbumEditorSheet.swift — pre-fills from first.albumArtist ??
first.artist.
AlbumDetailView.swift — buildAlbumWithSongs now passes albumArtist
from the companion songs.
Companion — 2 fixes:
apply_tags — now does full FLAC cleanup (removes all Picard legacy
variants) before writing, same as apply_tags_dict already did.
edit-metadata endpoint — no longer calls restructure_file. File
renaming only happens via /bulk-fix. This was the root cause of the
500 errors on compilation tracks with disc numbers.
2026-04-11 00:50:37 -07:00
Dallas Groot
fde3df0d26 fixed library management 2026-04-10 16:22:49 -07:00
Dallas Groot
5b319ad643 updated companion api 2026-04-10 15:23:43 -07:00
Dallas Groot
9c93be200e fixed docker compose
The fix uses a single ./companion_data:/app/data bind mount instead.
The server’s init_db() already calls os.makedirs for cover_art and
artist_photos subdirectories on startup, so they’ll be created
automatically inside ./companion_data/ on first run.
2026-04-10 08:46:08 -07:00
Dallas Groot
99e849b262 companionapi now will be the main library 2026-04-10 08:36:06 -07:00
Dallas Groot
9f15898cfd Added companion_api 2026-04-06 11:57:16 -07:00