Commit graph

2215 commits

Author SHA1 Message Date
JohnBaumb
ea875cc7af fix: throttle auth last_used_at config writes
Every authenticated API request previously called config_mgr.set(api_keys),
which rewrites the entire app config blob to SQLite. Under load this caused
significant write amplification and lock contention.

Persistence of last_used_at is now throttled per key hash to once every
15 minutes. The in-memory timestamp on the matched key is still updated
immediately, so reads within the same process see the live value; only
the on-disk persistence is throttled.
2026-04-19 15:22:24 -07:00
BoulderBadgeDad
e0f036df08
Merge pull request #328 from JohnBaumb/feature/deep-linking
Add URL-based deep linking for SPA navigation
2026-04-19 13:07:46 -07:00
Broque Thomas
c940363ec2 Fix CI test failures from incomplete dummy config and encoding
8 test files had _DummyConfigManager missing get_active_media_server(),
causing failures when pytest ran them before the test file that had it.
Whichever file set sys.modules first won, and the incomplete dummy broke
later tests. Also fix script.js read_text() missing encoding='utf-8'
which failed on non-UTF-8 default locales.
2026-04-19 13:04:55 -07:00
BoulderBadgeDad
12087f2407
Merge pull request #327 from kettui/fix/artist-details-refactoring
Refactor artist-detail discography flow
2026-04-19 12:53:35 -07:00
Broque Thomas
f9de081bd5 Fix library page crash when All letter filter is used
soul_id.startsWith() threw TypeError for non-string values, crashing
the entire card rendering pipeline. Letter-specific filters worked
because the problematic artist wasn't in those filtered results.
Added String() wrapper on all 3 soul_id.startsWith calls and a
try-catch around individual card rendering so one bad card can't
take down the whole page.
2026-04-19 12:48:53 -07:00
JohnBaumb
5af4dc7853 test: add unit tests for SPA deep-linking catch-all route 2026-04-19 10:56:13 -07:00
JohnBaumb
7d311451cb feat: URL-based deep linking for SPA navigation
- Flask catch-all route serves index.html for client-side paths, excluding api/static/auth/callback/status prefixes.- navigateToPage pushes history state so URL reflects current page.- popstate listener handles browser back/forward without reloading.- Initial load reads window.location to restore the page after refresh or direct link.- artist-detail and playlist-explorer fall back to parent pages since they need runtime context.
2026-04-19 10:46:58 -07:00
Antti Kettunen
c72619596c
Add missing PYTHONPATH to test run step
Likely the cause for modules not being found
2026-04-19 20:45:36 +03:00
Antti Kettunen
32e2281b9c
Refine variant release dedup
- broaden the artist-detail dedup helper to catch trailing parenthetical edition and remaster variants
- keep the legacy hyphenated suffix fallback for older metadata
- add regression coverage for language-specific Edition and remaster cases
2026-04-19 20:38:50 +03:00
Antti Kettunen
33b4ea6429
Refine artist-detail discography flow
- move artist-detail discography resolution onto the shared source-priority metadata service
- keep the variant dedup helper in the UI-facing adapter
- pass the chosen source through completion checks
- add coverage for the new adapter and dedup behavior
2026-04-19 20:38:49 +03:00
BoulderBadgeDad
dbaeba33dd
Merge pull request #325 from kettui/ci/build-and-test-workflow
Add a simple workflow for running build + test on pushes
2026-04-19 10:29:55 -07:00
BoulderBadgeDad
12837e96d3
Merge pull request #324 from kettui/fix/artist-discography-completion-refactoring
Refactor artist discography completion metadata flow
2026-04-19 10:27:51 -07:00
Antti Kettunen
ba2803551a
Update actions to latest 2026-04-19 19:28:06 +03:00
Broque Thomas
ef41e5f8b3 Fix artist sync 'Artist not found' for Navidrome/Jellyfin text IDs
The ID resolver tried int() conversion first, which fails for text-based
IDs from Navidrome/Jellyfin. Now tries direct string match first (works
for both text and integer IDs), then integer fallback, then source
columns. Also added discogs_id to source column search. Fixes #323
2026-04-19 09:20:22 -07:00
Broque Thomas
afc91c1397 Delete .lrc and .txt sidecar files when removing tracks from disk
Track and album delete with file removal now also cleans up associated
lyrics sidecar files (.lrc synced, .txt plain) that share the same
base filename as the audio file. Fixes #322
2026-04-19 09:14:22 -07:00
Antti Kettunen
63059bb78f
Add a simple workflow for running build + test on pushes
Install dev dependencies, compile Python sources, and run pytest on every push to catch any potential issues that might've gone unnoticed during development
2026-04-19 17:32:42 +03:00
Antti Kettunen
17865fe712
Refactor artist discography completion metadata flow
Move completion checks into metadata_service and make them follow the configured metadata source priority.

Drop the old test-mode path, remove the web_server wrapper indirection, and keep artist inference on explicit release metadata instead of guessing from a track search.

Add coverage for the source-priority completion behavior and the safer artist-name handling.
2026-04-19 15:40:08 +03:00
Broque Thomas
abb08efe74 Fix album 404 on library page when Spotify is rate limited
_resolve_db_album_id was missing deezer_album_id from stored ID checks
and hardcoded Spotify for the name-based search fallback. When Spotify
was rate limited (common for new Navidrome users), no fallback was tried
and the album returned 404.

Now checks all stored IDs (spotify, deezer, itunes, discogs) in priority
order matching the active metadata source, and falls back through all
available sources for name-based search instead of only Spotify.
2026-04-19 01:02:01 -07:00
Broque Thomas
0380e88bb0 Fix MusicBrainz tab missing from enhanced search results
MusicBrainz was returned by the backend as an alternate source but the
frontend's orderedSources list didn't include it, so it was never fetched.
2026-04-18 23:52:48 -07:00
Broque Thomas
2bd8d2ac7a Version bump to 2.33 2026-04-18 23:39:26 -07:00
Broque Thomas
63230ae39c Add bottom padding to library pagination for scroll breathing room 2026-04-18 23:35:28 -07:00
Broque Thomas
533091f605 Update What's New — live log viewer now mentions search and smart filtering 2026-04-18 23:26:04 -07:00
Broque Thomas
3404812a1e Improve live log viewer — fix level filters, faster updates, add search
- Fix level filter showing nothing: now uses heuristic classification
  for print() output (error/traceback/failed→ERROR, warn→WARNING, etc.)
  in addition to exact logger format matching
- Speed up WebSocket updates from 2s to 0.5s polling
- Add search box with 300ms debounce — filters both initial load and live
- Use DocumentFragment for batch DOM appends (performance)
- Increase line cap from 1000 to 2000
- Backend search parameter support in /api/logs/tail
2026-04-18 23:13:51 -07:00
Broque Thomas
8b0e619fa1 Add live log viewer on Settings → Logs tab
Terminal-style real-time log viewer with:
- Log file selector (app, post-processing, acoustid, source reuse)
- Color-coded log levels (DEBUG gray, INFO blue, WARNING yellow, ERROR red)
- Level filter buttons (All/Debug/Info/Warn/Error)
- Auto-scroll with toggle, copy and clear buttons
- Live updates via WebSocket (2s polling, pushes new lines)
- Initial load fetches last 200 lines via REST API
- 1000-line display cap with oldest lines trimmed

Also fixes Advanced tab settings (Discovery Pool, Security, etc.) being
hidden inside collapsed Library Preferences section body — misplaced
closing div caused them to be invisible.
2026-04-18 22:57:15 -07:00
Broque Thomas
c0c38268f5 Fix tool help modal not closable from Automations page
The close button and backdrop click handlers were only attached when
the Tools page was visited (initializeToolHelpButtons). Automation
builder '?' buttons open the same modal but the close handlers were
never set up. Added inline onclick handlers to the modal HTML and a
global Escape key listener so closing works from any page.
2026-04-18 21:49:30 -07:00
Broque Thomas
07d67e8517 Fix Your Albums section opening playlist modal instead of album modal
Your Albums cards on the Discover page were using the YouTube/playlist
modal (openDownloadMissingModalForYouTube) instead of the album modal
(openDownloadMissingModalForArtistAlbum). Now displays with proper
album hero section and uses album download context for file organization.
2026-04-18 21:44:18 -07:00
Broque Thomas
aa8f97e3d5 Add optional ReplayGain analysis to post-processing pipeline
New toggle in Settings → Library → Post-Processing: "Apply ReplayGain
tags after download". When enabled, analyzes loudness via ffmpeg's
ebur128 filter and writes track-level ReplayGain gain/peak tags.
Runs after metadata tagging but before lossy copy so both files get
the tags. Off by default — adds a few seconds per track.

Applied to both album and playlist/single download paths.
2026-04-18 21:04:01 -07:00
Broque Thomas
461f28f084 Fix Spotify OAuth stealing ports in Docker on fresh installs
When no cached token exists, spotipy's auth probe starts an interactive
OAuth flow that binds 127.0.0.1:<redirect_port> inside the container.
This either steals Flask's port 8008 (crash loop) or binds loopback-only
on 8888 (unreachable from Docker host — 'connection reset by peer').

Now checks for a cached token before probing. If none exists, returns
False immediately so users authenticate via the SoulSync web UI instead.
No behavior change for already-authenticated users.

Fixes #269
2026-04-18 20:46:22 -07:00
Broque Thomas
288994e081 Update What's New with all today's features and fixes
Added: Genre Whitelist, Standalone Full Refresh, Folder Terminology
Rebrand, and 12 bug fixes (duplicate detector, single track downloads,
liked songs source label, metadata crash, scan button stuck, deep scan
logging, settings tab flash, standalone verify speed, and more).
2026-04-18 20:41:59 -07:00
Broque Thomas
cdcb05892a Expand default genre whitelist from 223 to 272 genres
Added Alternative, Indie, Dance (common Spotify umbrella genres),
modern genres (Phonk, Hyperpop, Cloud Rap, Emo Rap), regional pop,
additional rock/metal/electronic subgenres, world music traditions,
and media genres (Video Game Music, Anime). Intentionally excluded
mood/activity tags (Chill, Workout, Sleep) as non-genres.
2026-04-18 20:32:49 -07:00
Broque Thomas
e8094c2218 Fix genre whitelist settings not saving — add to allowed config keys
The genre_whitelist key was missing from the settings POST handler's
service whitelist, so the config was silently dropped on save.
2026-04-18 20:26:37 -07:00
Broque Thomas
288776a7f3 Add genre whitelist for filtering junk tags during enrichment
New core/genre_filter.py with ~180 curated default genres. When strict
mode is enabled in Settings → Library Preferences → Genre Whitelist,
only whitelisted genres pass through during enrichment. Junk tags from
Last.fm (artist names, radio shows, playlist names) are silently dropped.

Applied at all 10 genre write points: Spotify, Last.fm, AudioDB, Deezer,
Discogs, iTunes, Qobuz enrichment workers + post-processing genre merge
+ initial download artist/album creation.

Strict mode is OFF by default — zero behavior change for existing users.
First enable auto-populates the whitelist with defaults. Users can add,
remove, search, and reset genres via the Settings UI.
2026-04-18 20:23:53 -07:00
Broque Thomas
c6de707f94 Fix single track search results downloading with album context
When clicking a track in enhanced or global search, the download modal
correctly showed SINGLE but the download used is_album_download=true,
causing the file to be organized under the album path template instead
of the singles template. Now enhanced_search_track_ and gsearch_track_
prefixes pass album metadata for tagging but set is_album_download=false.
2026-04-18 19:46:20 -07:00
Broque Thomas
1564d7bd53 Fix Liked Songs playlist misidentified as YouTube source
The source detection chain for playlist hero sections didn't handle
the 'spotify:liked-songs' playlist ID prefix, falling through to the
default 'YouTube' label. Added 'spotify:' prefix check.
2026-04-18 19:21:25 -07:00
Broque Thomas
62251a66bf Improve deep scan logging — show existing track counts, not just new
Per-artist log lines now show the full details string from the worker
(e.g. "5 albums, 0 new tracks (150 existing updated)") instead of
just "5 albums, 0 tracks". Finished message shows "library up to date"
when no new content is found instead of "0 successful, 0 failed".
2026-04-18 19:10:35 -07:00
Broque Thomas
0e8e3e86a0 Fix Duplicate Detector ignoring 'allow duplicate tracks across albums'
The Duplicate Detector repair job had its own ignore_cross_album setting
that was independent of the global allow_duplicate_tracks setting. When
a user enabled 'Allow duplicate tracks across albums', the detector
still flagged same-titled tracks on different albums as duplicates.
Now respects the global setting — if duplicates are allowed, cross-album
matches are always skipped.
2026-04-18 18:55:02 -07:00
Broque Thomas
a02266596a Add Full Refresh support for SoulSync standalone mode
Full Refresh now clears all soulsync library records and rebuilds from
file tags in the output folder. Reads tags via Mutagen, groups by
artist/album, creates DB records with stable IDs. Files stay in place.
Previously Full Refresh did nothing for standalone — just returned.
2026-04-18 18:29:02 -07:00
Broque Thomas
6036e02011 Fix library scan button stuck on 'Stop' and stale count shown as 'failed'
Dashboard scan polling checked for 'completed' but backend sets 'finished'.
Added 'finished' to the completion check so polling stops, button resets,
stats refresh, and toast fires correctly. Also fixed deep scan reporting
stale record removals as 'failed' instead of 'successful'.
2026-04-18 18:19:49 -07:00
Broque Thomas
2c15d50bff Fix metadata enhancement crash when album_info is None
Playlist and single track downloads pass None as album_info to
_enhance_file_metadata. The downstream _extract_spotify_metadata
called .get() on it without a null guard, crashing with AttributeError.
2026-04-18 18:12:39 -07:00
Broque Thomas
f5a2d51d4e Speed up standalone verify button — stop counting after 10 files
Was walking the entire directory tree counting up to 100 audio files,
taking 60+ seconds on large libraries. Now breaks after 10 files.
2026-04-18 17:54:37 -07:00
Broque Thomas
f8e4adde41 Remove redundant output path mirror from standalone config section
The disabled path field on the Connections tab was showing stale data
(always ./Transfer) because it read from the DOM before settings loaded.
Removed it entirely — the output path is configured on the Downloads tab.
Standalone section now just shows description + verify button.
2026-04-18 17:53:07 -07:00
Broque Thomas
db7714c4db Fix settings page showing all tabs on first load
Non-active tab groups were visible during async data loading because
switchSettingsTab ran after the awaits. Moved it before async calls and
added CSS defaults to hide non-connections groups, preventing any flash.
2026-04-18 17:50:05 -07:00
Broque Thomas
efe8280e23 Rebrand folder terminology: Download→Input, Transfer→Output, Staging→Import
All user-facing labels, docs, help text, tooltips, error messages, and debug
info output updated. Backend config keys, variable names, actual path values,
and Docker volume mounts are completely unchanged — zero functional impact.
2026-04-18 17:35:20 -07:00
Broque Thomas
cef1162c5e Update What's New with today's features and fixes 2026-04-18 16:07:33 -07:00
Broque Thomas
b17a6e2dd7 Add per-artist metadata source override for watchlist scans
Users can now override which metadata provider (Spotify, Deezer, Apple Music,
Discogs) is used when scanning a specific watchlist artist for new releases.
The selector appears in the artist config modal and only shows sources the
artist has enrichment IDs for. Default behavior is unchanged — all artists
use the global metadata source unless explicitly overridden.
2026-04-18 16:05:05 -07:00
Broque Thomas
f749bb9604 Fix AcoustID mismatch fix failing with 'uuid' UnboundLocalError
The redownload branch had `import json, uuid` locally inside the function,
which caused Python to treat `uuid` as a local variable for the entire
function scope. When the retag branch ran instead, `uuid` was unbound.
Both modules are already imported at the top of the file.
2026-04-18 15:06:54 -07:00
Broque Thomas
381e37ecf7 Enhance logging, debug info, and add Troubleshooting docs section
- Move Log Level dropdown from Downloads tab to Advanced tab (Settings)
- Fix staging path config key (import.staging_folder → import.staging_path)
- Fix library stats showing 0 (use get_database_info_for_server like dashboard)
- Add Troubleshooting & Support docs section (log files, debug info, common issues, reporting)
- Beef up Copy Debug Info: ffmpeg version, runner type, Discogs status, wishlist count,
  music library paths, music videos dir, log level, metadata source, hybrid priority,
  lossy copy config, auto import, duplicate tracks, replace quality, log file listing
- Add GitHub issue link footer to debug output
- Add discogs to enrichment worker list in debug endpoint
2026-04-18 15:05:19 -07:00
BoulderBadgeDad
c473bf777c
Merge pull request #318 from kettui/feat/artist-discography-refactoring
Centralize metadata lookup for artist discography
2026-04-18 13:15:49 -07:00
Broque Thomas
1527fea5a1 Merge branch 'main' of https://github.com/Nezreka/SoulSync 2026-04-18 12:33:14 -07:00
BoulderBadgeDad
f636014b9a
Merge pull request #316 from kettui/fix/reduce-ui-stalls
Reduce UI stalling during enhanced search, add caching & small concurrency optimizations
2026-04-18 12:32:55 -07:00