Commit Graph
428 Commits
Author SHA1 Message Date
zarzet bd2bd85c9e refactor(go): split per-format scanners and incremental scan out of library_scan.go 2026-07-27 00:21:04 +07:00
zarzet 1b861f9ae8 refactor(go): split result/overlay helpers and output builders out of extension_fallback.go 2026-07-27 00:20:04 +07:00
zarzet 8a95f684d2 refactor(go): split deezer models, cache upkeep, and browse endpoints out of deezer.go 2026-07-27 00:18:45 +07:00
zarzet 358154c39e refactor(go): split lyrics provider config, LRC codec, and search matching out of lyrics.go 2026-07-27 00:16:18 +07:00
zarzet ea172ba17b refactor(go): split package validation and VM lifecycle out of extension_manager.go 2026-07-26 23:05:30 +07:00
zarzet 9dc44ecd88 refactor(go): split Ogg parsing and cover-art extraction out of audio_metadata.go 2026-07-26 22:39:58 +07:00
zarzet 2dbf8f6f9b refactor(go): split M4A/MP4 tagging out of metadata.go 2026-07-26 22:38:08 +07:00
zarzet 1cda88cafc perf(metadata): cache MusicBrainz ISRC lookups in the finalize path 2026-07-26 22:15:04 +07:00
zarzet 6fcfb67af2 perf(go): cut redundant signed-session writes, progress-callback churn, tombstone growth 2026-07-26 22:14:58 +07:00
zarzet fa7ef84b39 fix(extensions): anchor URL handler patterns to the host
MatchesURL treated patterns as substrings of the whole URL, so
"spotify.com" matched any URL embedding it in a query parameter and a
hostile query string could route a link to the wrong handler. Patterns
now anchor to the URL host (exact domain or subdomain, optional path
prefix); "scheme:" patterns anchor to the URI front. With several
matching handlers, FindURLHandler now breaks the tie via the user's
metadata provider priority instead of Go's random map order.
2026-07-26 19:14:31 +07:00
zarzet 42c266eafc fix(extensions): enforce minAppVersion and requiredRuntimeFeatures on load
Both manifest gates were parsed but only checked by the Store UI, so
manual .sflx installs and directory loads of incompatible extensions
failed cryptically at runtime despite SIGNED_SESSION_GUIDE promising a
clear refusal. validateExtensionLoad now rejects them on every install
path, and ensureRuntimeReady re-checks so a gated package cannot be
enabled anyway. Unknown runtime features and too-new feature contract
versions fail with explicit messages; an empty app version (tests)
skips the version gate.
2026-07-26 19:14:29 +07:00
zarzet 74615a60b5 refactor: consolidate lyrics builders, cancel registries, and priority plumbing 2026-07-26 19:08:22 +07:00
zarzet 69830f6d46 refactor(go): consolidate duplicated track maps, selectors, and small helpers 2026-07-26 18:57:44 +07:00
zarzet a21d5bcb33 feat(library): ISRC duplicate detection beyond FLAC with review sheet
The download-time ISRC index now also parses mp3, m4a, ogg, and opus
tags through the existing native readers instead of skipping everything
but .flac. Library settings gain a Review duplicates sheet that groups
history and local-library rows sharing an ISRC via SQL over the
attached databases (no filesystem walk, SAF-safe), shows quality
badges, and offers keep-best and per-copy delete with confirmation.
2026-07-26 18:49:58 +07:00
zarzet 04a71d0211 refactor: remove orphaned bridge, database, and queue helpers 2026-07-26 18:43:53 +07:00
zarzet d4f0b84615 feat(track): add Open on... platform links sheet
Track options gain an Open on... entry listing every streaming platform
song.link resolves for the track, served by a new generic
GetTrackPlatformLinks with its own memory cache beside the availability
cache (same request budget). The sheet is data-driven from the platform
map so the app core stays service-agnostic. Completes the bridge
wrappers already landed in 901fa34d; also carries the en strings for
the duplicate review sheet landing next.
2026-07-26 18:42:41 +07:00
zarzet 901fa34d80 refactor(bridge): remove dead cross-layer platform bridge methods 2026-07-26 18:32:40 +07:00
zarzet 48f01ba146 fix(extensions): isolate invalid registry checksums 2026-07-26 12:29:28 +07:00
zarzet 5f5186a23e fix(reenrich): preserve release identity in batch actions 2026-07-26 12:28:00 +07:00
zarzet c4abbf8743 fix(verification): recover signed-session bootstrap failures 2026-07-26 11:09:18 +07:00
zarzet 08d648cfa8 fix(reenrich): allow correcting stale release metadata 2026-07-26 01:28:25 +07:00
zarzet 40dd9bb68f fix(download): avoid unsafe automatic range resume 2026-07-26 01:28:09 +07:00
zarzet fbe0674b04 test(go): close output handle before cleanup 2026-07-26 01:14:58 +07:00
zarzet 1705fb2a81 feat(extensions): verify decentralized package integrity 2026-07-26 01:14:35 +07:00
zarzet cbd8fd0342 style(go): apply Go 1.26 formatting 2026-07-25 10:20:03 +07:00
zarzet 01c08322c1 fix(extensions): preserve explicit track metadata 2026-07-24 21:32:13 +07:00
zarzet a41074d271 chore(deps): update Flutter, Go, and native dependencies 2026-07-24 20:37:07 +07:00
zarzet 452a15b652 fix(lyrics): reject mismatched search results 2026-07-24 18:48:05 +07:00
zarzet 685392f073 fix(download): accelerate verified extension resumes 2026-07-23 09:56:39 +07:00
zarzet 0c558fb33b test(backend): use a valid descriptor in fd coverage 2026-07-23 09:56:22 +07:00
zarzet b7e96facbe fix(logging): keep cursors valid after rollover 2026-07-16 10:56:26 +07:00
zarzet 648f36244b perf(go): add runtime metrics and benchmarks 2026-07-16 10:53:26 +07:00
zarzet b5d02da759 perf(dedupe): batch isrc lookups under one lock 2026-07-16 10:48:57 +07:00
zarzet c13fdcc6e1 perf(library): scan flac and m4a in one pass 2026-07-16 10:47:29 +07:00
zarzet 5846dc2416 perf(extensions): invoke goja providers directly 2026-07-16 10:39:03 +07:00
zarzet ef89352d09 perf(memory): drop disposable caches on pressure 2026-07-16 10:32:33 +07:00
zarzet c75139450a fix(extensions): bound file reads 2026-07-16 10:26:43 +07:00
zarzet 07c9cf034f fix(extensions): bound cookie runtime state 2026-07-16 10:24:13 +07:00
zarzet b69f67a786 fix(download): name variants by measured quality 2026-07-16 09:20:35 +07:00
zarzet 0961c09a6d feat(download): preserve quality variants 2026-07-16 08:45:01 +07:00
zarzet bab954c6d9 fix(extensions): harden package and runtime lifecycle 2026-07-15 21:31:16 +07:00
zarzet ed9511b17f refactor(library-scan): reuse applyAudioMetadataToScan for M4A/MP3/APE
The M4A, MP3, and APE scanners hand-copied AudioMetadata into the scan result
field-for-field, identical to the existing applyAudioMetadataToScan helper
(same Date-else-Year fallback). Route them through it. Ogg is left as-is (it
intentionally has no Year fallback) and FLAC uses the separate Metadata type.
2026-07-14 19:00:34 +07:00
zarzet f0afb1382e refactor(backend): drop dead exports/availability path and dedup Go tag writers
Remove the never-called checkAvailability chain end to end (Dart bridge +
provider, Android/iOS MethodChannel handlers, Go exports) and stop restoring
its persistent lookup cache on every cold start; the legacy prefs key is
cleared on next cache reset.

Delete dead Go: romaji.go (test-only), the no-op pre-warm chain
(PreWarmTrackCache/PreWarmCache/…), retired Download stubs, and a batch of
exports with no Dart/Kotlin/Swift/Go caller. Kept GetTrackCacheSize/
ClearTrackIDCache (Settings cache screen), SetAllowedDownloadDirs and
Clear/GetItemProgress (live test seams).

Dedup: single updateFlacVorbis + replaceFlacPictures helper behind the six
FLAC tag writers; merge byte-identical extractCommentFrame/extractLyricsFrame
into extractLangTextFrame.

go build/vet + 237 go tests, flutter analyze + tests green.
2026-07-14 18:25:13 +07:00
zarzet f09c607aab fix(extensions): surface swallowed signed-session verification in provider fallback
Two holes let a provider's verification requirement vanish so the fallback
chain failed outright instead of opening the challenge:

- classifyDownloadErrorType did not recognize 'signed session expired'
  (the exact error ensureSignedSession returns), so an expired session
  failed generically.
- Extensions that catch the needsVerification response internally (e.g.
  qobuz-web's availability search) report a plain 'not available', which
  the fallback loop skipped past silently.

The runtime now remembers when a signed-session call inside the current
script invocation required verification; the provider wrapper consumes
that after checkAvailability/download and tags the failure as
verification_required, regardless of how the script handled it. The
source-extension path also classifies thrown errors now.
2026-07-14 16:34:43 +07:00
zarzet 3833a66bf6 fix(metadata): send Accept-Language on Deezer requests so names follow the app language
Deezer localizes artist and genre names by IP geolocation when no language
is given, so users behind e.g. Arabic-region IPs got Arabic metadata on an
English device (VPN 'fixed' it). The app's display language is now pushed
to the backend and sent as Accept-Language, with an en-US default.

Fixes #480
2026-07-14 15:46:33 +07:00
zarzet 9ac10dd6bb feat(player): ReplayGain/R128 volume normalization for the built-in player
Reads REPLAYGAIN_TRACK_GAIN (album gain fallback) from FLAC/MP3/M4A tags
and converts Opus R128_TRACK_GAIN/R128_ALBUM_GAIN (Q7.8, -23 LUFS) to the
same ReplayGain dB representation on the Go side, then attenuates the
internal player's volume per track. Off by default; toggle lives under
Library > Playback. Opus header output gain is left to the decoder, which
already applies it.

Closes #465
2026-07-14 15:18:42 +07:00
zarzet 4605517d55 fix(download): skip AC-4 repair for non-MP4 decrypt output
Decrypt can emit a raw FLAC stream; the AC-4 repair step fed it to the
MP4 box parser, which failed with a garbage atom type whose control
bytes then broke the unescaped Kotlin error JSON (FormatException in
Dart). Guard the repair call by extension, sniff the box type in Go as
a second layer, and build platform error JSON with JSONObject.quote.
2026-07-14 14:32:29 +07:00
zarzet cdc1ba0a68 feat(net): DoH fallback, uTLS pool flush on cleanup, retry hardening
- Resolve over DNS-over-HTTPS (1.1.1.1/8.8.8.8, cached, SSRF-filtered)
  when the OS resolver fails, on all transports and the uTLS dial path,
  so DNS-level ISP blocking no longer kills the connection outright
- Flush the pooled uTLS h2 conns from CloseIdleConnections so a network
  switch no longer leaves the first bypass request hanging on a dead conn
- Abort retry backoff sleeps on context cancellation
- Cap honored Retry-After at 2 minutes
- Restore the response body consumed by the 403/451 marker scan
2026-07-14 12:49:43 +07:00
zarzet bd9b98b942 fix(go): build with Go 1.26.5 for aligned cgo frames, safe on arm32
Fixes the random gobind crash 'bulkBarrierPreWrite: unaligned arguments'
(golang/go#46893; cgo aligns exported-function argument frames since
1.26.0). The earlier 1.26 rollback (cdc58367) was the arm32 SIGSYS from
probing futex_time64 under seccomp on Android <=10 — fixed in 1.26.3 by
gating time64 syscalls on kernel >= 5.1 instead of probing (verified in
the 1.26.5 runtime source, which names Android 8-10 explicitly).
go directive carries the full patch version so gomobile's synthesized
bind module picks the same toolchain.
2026-07-14 12:20:53 +07:00
zarzet b53146c599 fix(reenrich): keep release identity when the matched track is from another album
An ISRC identifies a recording, not a release, so identifier-first and
search matches could resolve to a compilation of the same song and
overwrite the file's album, cover, track position, and date with the
compilation's. When the file already knows its album and the candidate's
album doesn't match, those release-scoped fields are now preserved;
recording-level fields (title, artist, ISRC, genre) still enrich.
2026-07-14 09:10:14 +07:00