Commit Graph
149 Commits
Author SHA1 Message Date
zarzet 796b26ba56 fix(link): let the server derive starred artist ids from names
The app reported favorite artists as ids it computed with a looser
normalization than the catalog, so some never matched. getStarred now
sends artist names and the server maps them with its own rule; unstar
matches favorites by name as well.
2026-10-25 02:38:02 +07:00
zarzet b0a02c6bd2 fix(link): list OpenSubsonic extensions without credentials 2026-10-25 02:30:05 +07:00
zarzet e78b53b2c4 Merge branch 'link/l1b-subsonic' into link/integration
# Conflicts:
#	rust_backend/crates/link/Cargo.toml
2026-10-25 02:29:31 +07:00
zarzet 7b72b384ba feat(link): serve the desktop library over OpenSubsonic
Index the NDJSON catalog export into albums, artists, genres and a
case- and diacritic-insensitive search, with contract ids (al-/ar- +
16 hex of SHA-256). Answer the catalog endpoints in OpenSubsonic JSON
or Subsonic XML, stream and download files with single-range support,
transcode through ffmpeg when asked (killed when the client goes
away), resize and cache cover art, and forward playlists, stars,
scrobbles and the play queue to the app with song ids expanded both
ways.
2026-10-25 02:28:06 +07:00
zarzet b53d12db58 feat(link): add the HTTPS server core and desktop link methods
Implements the Mornye Link server core (unit L1a) in mornye-link:
- tls: self-signed ECDSA P-256 certificate for mornye.local, generated
  once into cert.pem/key.pem, pinned by its SHA-256 fingerprint
- store: server.json and devices.json, atomic private writes
- auth: Subsonic apiKey, salted token and password schemes, Bearer keys
- pairing: 6-digit PIN window with HMAC proof, attempt limit, expiry
  and a per-address rate limit
- server/api: own Tokio runtime, port policy with persistence, dual-stack
  TLS listener, /rest routing to the Subsonic layer, /mornye/v1 info,
  pair, ws and forwarding with a request timeout
- ws: hello/welcome sessions, client list events, pushes, pings and
  idle drop, newest connection per device wins
- mdns: _mornye._tcp advertisement, best effort

mornye-desktop gains the link* methods and bridges forwarded requests
to Dart as linkRequest inbound calls answered by linkReply.
2026-10-25 02:24:55 +07:00
zarzet d430bd73d7 feat(link): add the Mornye Link crate skeleton and shared protocol types
Mornye Link lets the phone app use the desktop app over the local
network. This adds the mornye-link crate with the types its server and
Subsonic layers share, and the Dart protocol models, desktop request
router and phone client interface the feature units build on.
2026-10-25 01:57:47 +07:00
zarzet c55f513a77 chore(rust): update toolchain, Tokio, scraper and lockfile dependencies
Rust 1.99.1, Tokio 1.54.1, zip 9.0.5, libc 0.2.191 and
rustls-native-certs 0.8.5. scraper 0.29 moves to html5ever 0.40, so
the parser pin follows it. The Unicode 15 table pins and the vendored
rustix, cap-std and libusb1-sys sources stay as they are.
2026-10-24 12:12:27 +07:00
zarzet 29ded7e46e perf(preview): resolve extension previews when they play
Extensions that require the new deferredPreview runtime feature return
mornye-preview:<extension>/<track> links instead of a sample URL. The
preview player resolves such a link through the extension's
resolvePreview function when the preview starts, so a search no longer
waits for one sample lookup per track.
2026-10-24 11:35:08 +07:00
zarzet 22a0bee300 fix(downloads): trust the audio bytes over a provider's FLAC label
A provider could label a download as FLAC while returning other bytes,
and the backend then wrote FLAC tags into them and failed with "fLaC
head incorrect" (Mornye-Desktop issue #6), ending the whole download.
The download probe now reads the container from the file itself: FLAC,
including behind an ID3v2 tag, MP4 or MP3. A FLAC label on MP4 or MP3
bytes yields to the bytes, so the file is published with its real
suffix and FLAC in MP4 is still remuxed by the app. Unrecognized bytes
behind a FLAC label, such as an error page, fail that provider with a
clear message so the next provider can try.
2026-10-24 10:47:45 +07:00
zarzet 69407ccb31 feat(extensions): allow a network permission for any domain
Extensions that talk to self-hosted servers cannot know the host when the
manifest is written. A "*" entry in permissions.network now admits every
host, while HTTP still requires allowHttp and private or local addresses
still require the app's local network setting.

The extension detail page names the "*" grant and the HTTP grant instead
of showing them as ordinary domains.
2026-10-23 18:51:49 +07:00
zarzet 30c3e42d7d fix(lyrics): recover download lyrics after provider failures 2026-10-23 17:37:43 +07:00
zarzet 44c9ba9213 fix(automix): verify beat alignment and hold phase through the mix
Beat detection normalizes onsets against nearby energy, so a fade, a
loud fill or a quieter verse no longer dominates the pulse, and refines
the tempo in 0.01 BPM steps. The Dart and native analyzers stay in step.
An uncertain grid is retried on nearby windows and only accepted when
tempo and phase agree at both edges of the transition.

A beat-matched start now checks that the incoming deck actually landed
on the outgoing beat. When it cannot be verified, the mix falls back to
an unstretched crossfade instead of a misaligned stretch. During the
overlap, a phase lock makes small, bounded rate corrections from spaced
position samples and stops correcting when those samples are unreliable.

A measured but uncertain pulse gets a bass handoff without any tempo
change, and speed effects skip beat matching.
2026-10-23 15:39:44 +07:00
zarzet f37f7b1652 fix(tags): support ID3-prefixed FLAC metadata writes 2026-10-23 05:08:33 +07:00
zarzet 30a5c82f0f feat(library): list the files a scan could not read
A finished scan only reported how many files it skipped. The Rust
scanner and the Android SAF scan now record the first 100 failed files
with the reader's reason and include them in the finished progress
report.

Library settings show the count under each folder, and its actions
open a sheet listing each file, its folder and the reason. The list is
kept per folder across restarts, cleared by a clean scan and removed
with the folder. Network folders keep only the count.

Validation: provider, model and Rust scan tests, and the full Flutter
suite on a clean tree with only this series applied.
2026-10-23 03:50:05 +07:00
zarzet 1c2cca6659 fix(library): index songs whose tags fail to parse
Android Library scans counted a file as an error whenever its tag reader
failed, even when the audio was fine, so mixed folders that other
players list cleanly reported dozens of errors.

- Opus and Vorbis files with a comment header but no title or artist
  read as untagged songs instead of failing.
- The comment header is read up to 16 MiB instead of 80 pages, so a
  large cover written on small pages no longer hides the tags.
- Raw ADTS .aac files read ID3 or APEv2 tags, a cover, and quality from
  their frame headers. MP4 .aac files keep the MP4 reader.
- An ID3v2 tag in front of a FLAC stream is skipped.
- Interrupted and short reads from provider descriptors are retried
  instead of failing the read, and the last direct SAF read waits
  400 ms before its retry.

Damaged FLAC, MP3 and AAC streams are still rejected.

Validation: 7 new mornye-core format tests (6 fail without this
change), mornye-core, mornye-extensions and mornye-mobile tests, clippy,
and 17 SafMetadataReadPolicyTest cases.
2026-10-23 03:50:00 +07:00
zarzet 2b257c36d8 fix(windows): support UNC library paths and network downloads 2026-10-22 23:51:19 +07:00
zarzet 07bc4c35da fix(desktop): restore private file access after cache removal 2026-10-22 23:44:48 +07:00
zarzet 104b8a8491 chore(license): adopt LGPL-3.0-only for Mornye 2026-10-22 23:11:09 +07:00
zarzet 10b561486e fix(library): read tagless audio without losing document names
Distinguish readable MP3 and MP4 streams without tags from failed metadata reads. Preserve partial ID3 and MP4 tags, use the original display name for tagless documents, and expose parser failures to Android SAF scanning. Cover tagless files, partial tags, invalid data, cancellation, and revoked documents.
2026-10-22 21:23:03 +07:00
zarzet 11a9b9a4ec chore: remove redundant comments across the codebase 2026-10-22 01:41:09 +07:00
zarzet 1ef604e635 feat(extensions): enable newly installed extensions by default 2026-10-21 19:47:05 +07:00
zarzet 876d4a4766 fix(library): keep scanning when a row has no scan time or is invalid
The Android DSD/WavPack reader built its library row without scannedAt.
Since the native staging validates required fields (d1de8331), one such
file failed the whole import with "Library scan row requires string
scannedAt", so a library containing a .dsf, .dff or .wv file could not
be scanned at all.

Stamp that row in Kotlin and fill a missing scannedAt during native
staging. A row that still cannot be encoded is counted, reported through
invalid_rows, invalid_row_error and invalid_row_paths, and skipped; the
owner logs it and protects the file's previous entry during publication,
as it does for a platform read error, instead of discarding the scan.
2026-10-21 14:22:46 +07:00
zarzet af500a737d feat(lyrics): choose lyrics from each provider in the metadata editor
"Find lyrics online" in the editor's lyrics section opens a sheet that
asks every enabled provider, extensions included, and lists each
answer in priority order with its timing and a preview. The chosen
lyrics fill the field and are saved with the other edits.

The backend gains getLyricsFromProvider, which asks one enabled
provider directly without the cache or the priority race, and
getEnabledLyricsProviders, wired for desktop, Android and iOS.
Provider display names move to a shared helper.
2026-10-21 11:35:19 +07:00
zarzet 2a9daecf1b fix(lyrics): match lrc.red recordings and collaborators
Keep all credited artists and title version markers when searching lrc.red, prefer the nearest matching duration, and invalidate cached results from the previous recording matcher. Preserve current Apple Music timing caches.
2026-10-21 03:49:12 +07:00
zarzet 0aeeeeb711 feat(desktop): add keep-awake, Discord IPC, folder watching and panic log to the Rust backend
The desktop crate gains the OS services the mobile hosts get from the
platform:
- beginKeepAwake/endKeepAwake: IOKit PreventUserIdleSystemSleep on macOS,
  SetThreadExecutionState on a holder thread on Windows, a systemd-inhibit
  idle:sleep lock on Linux.
- discordPresence* methods: Rich Presence over the Discord client's local
  RPC IPC, reporting discordPresenceStatus inbound calls.
- watchLibraryFolders/unwatchLibraryFolders: notify watches library roots
  and reports throttled libraryFolderChanged inbound calls.
- A panic hook appends to <app support>/logs/rust-panic.log.
2026-10-20 16:14:40 +07:00
zarzet ea75721dbc fix(extensions): confine extension files and packages on Windows
Reject extension-controlled names that Win32 resolves elsewhere: parent
components, root-relative, UNC and device paths, drive prefixes,
alternate data streams, reserved device names, wildcards and trailing
dots or spaces. The check covers relative sandbox paths, the remainder
below a granted directory, native replacement targets and package entry
names, which extraction joins with std::fs.

Native reads now walk each component through its verified parent handle
with FILE_FLAG_OPEN_REPARSE_POINT, rejecting symlinks, junctions and
mount points like the Unix openat walk. Non-link reparse files such as
cloud placeholders are reopened through the same parent so their filter
can supply data. Unix behavior is unchanged.
2026-10-20 14:19:11 +07:00
zarzet 86dbc2febe feat(core): read the local time zone on Windows
Windows has no zoneinfo tree. Build the local zone from
GetDynamicTimeZoneInformation like Go's initLocalFromTZI: one recurring
standard and daylight rule named "Local", biases from the current rules,
and abbreviations from the capitals of the English key name with a
numeric fallback. Disabled automatic daylight saving keeps standard
time. Other platforms keep the TZ and /etc/localtime lookup unchanged.
2026-10-20 14:19:11 +07:00
zarzet e1b4b48b8a fix(rust): gate unix filesystem calls for Windows builds
Add portable OpenOptions and DirBuilder helpers in mornye-core. Unix keeps
the exact O_NOFOLLOW, O_NONBLOCK and mode bits; Windows opens a final
link with FILE_FLAG_OPEN_REPARSE_POINT so the existing regular-file checks
reject it, and inherits directory ACLs instead of modes.

Use them in the lyrics cache, extension manager, repository cache and
download stores, make rustix a Unix-only dependency, and enable rquickjs
bindgen only off Windows: rquickjs-sys ships bindings for x86_64 and
aarch64 Windows MSVC, so Windows builds need no libclang.
2026-10-20 14:19:04 +07:00
zarzet 40f6f0b346 build(desktop): stage the desktop library from build_rust_backend.sh
Add a desktop mode that builds mornye-desktop for the host: a universal
macOS dylib (arm64 and x86_64, install name @rpath, ad hoc signed) or the
Linux shared library, staged under rust_backend/target/desktop/<os>/.
Document the intended Windows commands and the new crate in the README.
2026-10-20 13:45:43 +07:00
zarzet cbc2c312be feat(desktop): add Rust C ABI backend crate
Add crates/desktop (mornye-desktop), a cdylib for dart:ffi that implements
the desktop FFI contract: mornye_init, mornye_call, mornye_cancel,
mornye_subscribe, mornye_unsubscribe and mornye_free.

- Port the mobile host dispatcher once into a single method table: every
  CoreBackend.swift application method plus the Rust-backed AppDelegate
  osMethods, with plain filesystem paths. Other methods answer
  unimplemented.
- Run calls on an elastic worker pool; restore the $bytes_key binary
  argument; acquire native data job leases synchronously.
- Push download progress (kind 10), library scan progress (kind 11),
  inbound calls (kind 12) and log records (kind 13).
- Drain the backend FFmpeg command queue by spawning the configured
  ffmpeg executable, keeping staging then rename and cancellation.
- Re-export the mobile types the desktop crate dispatches to.
2026-10-20 13:45:43 +07:00
zarzet 51d3459426 chore(branding): drop remaining SpotiFLAC references
Remove the original SpotiFLAC creator and PC source links from About,
point docs links and podspec homepages at mornye.com, drop stale
SpotiFLAC build artifact cleanup, and rename incidental test data.
Legacy compatibility (backup magic, lyrics provider id, extension
suffix, signed session protocol) is kept so old data still loads.
2026-10-20 12:27:29 +07:00
zarzet 37e21b5712 feat(branding): rename app and native backend to Mornye
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases.

Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
2026-10-20 12:00:44 +07:00
zarzet 19056edf14 perf(library): cache unchanged SMB and WebDAV scan metadata 2026-10-20 00:28:55 +07:00
zarzet a3b14a285b fix(downloads): embed enriched artwork across audio formats 2026-10-19 23:47:40 +07:00
zarzet 9dc86e13f5 fix(artwork): read padded ID3 covers and repair cached previews 2026-10-19 23:47:18 +07:00
zarzet 18fd556869 chore(lyrics): rename first-party provider to Zarz-LRC
Update settings, About, provider descriptions, and lyric source credits. Preserve the stored provider ID and recognize both current and legacy credits as direct sources.
2026-10-19 11:18:45 +07:00
zarzet 00d476c146 docs(rust): describe the backend workspace, builds and bindings
Add rust_backend/README.md: crate map and dependencies, vendored patches, toolchain, host and Android/iOS build commands (all pass --locked; none pass --offline), NDK version and ABIs, UniFFI binding outputs and consumers, and the test layout.

Derived from rust_backend/Cargo.toml, rust-toolchain.toml, crate Cargo.toml files, uniffi.toml, the scripts/ build and check scripts, android/app/build.gradle.kts, ios/Podfile and .github/workflows/ci.yml.
2026-10-19 05:27:36 +07:00
zarzet 4791f55ad8 refactor(providers): share one Coalescer for single-flight request coalescing
The lyrics, MusicBrainz, platform resolver and availability services each
carried their own copy of the same single-flight machinery: a Flight with
an atomic waiter count, a result slot and condvar, a Waiter drop guard, a
worker check that fails once the last waiter leaves, a 25 ms wait_timeout
poll loop, a MAX_FLIGHTS (64) bound and a finish step that publishes the
result, removes the current flight, decrements the active count and wakes
shutdown.

Move that into crate::coalescer (Flight, Waiter, Coalescer). The table
stays inside each service's own state mutex, so cache lookups, joins and
finish remain atomic with that service's cache and generation. Per-site
rules stay at the call sites: cache keys, what finish caches and when,
error values, thread names, worker post-checks, panic messages,
MusicBrainz's atomic try_join, its spawn under the state lock and its
uncached spawn-failure path. Existing tests only change their access path
to the waiter and active counts.
2026-10-19 04:32:25 +07:00
zarzet c10c0ab5f5 docs(rust): add module docs to large modules without one
More than half of the crate files had no module doc, so a contributor had to
read a large file top to bottom to learn what it owns. Every file over 300
lines now states its responsibility in one or two lines.
2026-10-19 00:56:51 +07:00
zarzet affa63142c refactor(rust): rename mod.rs modules to the foo.rs + foo/ layout
Six modules used mod.rs while the rest of the workspace uses foo.rs next to a foo/ directory. Pure renames, no content change.
2026-10-19 00:56:21 +07:00
zarzet 190801c398 refactor(core): add fs::write_atomic and use it for the atomic file writes
Six writers repeated the same publication sequence: create a temporary file
in the target directory, write it, sync_all, optionally run a cancellation
check, then NamedTempFile::persist over the target. `core::fs::write_atomic`
runs exactly that order and optionally fsyncs the directory afterwards
(best effort, as extension storage did).

Each site keeps its temporary-file prefix (`.spotiflac-` for extension
storage, `.spotiflac-m3u-` for M3U export, tempfile's `.tmp` default,
exposed as `DEFAULT_TEMP_PREFIX`, for the registry cache, lyrics cache and
both network cover writers), its check placement between fsync and rename,
and its error text: `WriteAtomicError` displays a persist failure with
tempfile's own message, and converts to the underlying io::Error where the
site previously used `PersistError::error`.

Not converted, because their publication differs: playlist staging and
collection snapshots use persist_noclobber (collections also skips fsync),
the backup restore stages into a temporary directory, and the extension
package download maps each step to its own error context.

spotiflac-core now depends on the workspace `tempfile` already used by the
other crates; the lockfile only gains that edge.
2026-10-19 00:36:29 +07:00
zarzet f7a15cbd43 refactor(rust): consolidate small duplicate helpers
Keep one copy of helpers that were implemented several times, each proven
equivalent to the copies it replaces by a test that runs the removed
implementation (kept inline in the test module) against the survivor:

- Go-style lexical path clean: new `core::fs::clean`, used by
  `isrc::native_files` and re-exported as `extensions::files::clean`.
- Dart `String.trim` whitespace: `path_keys::dart_whitespace` and
  `dart_trim` now back the lyrics parser's explicit character list and the
  playlist importer's private `trim`; the test compares every Unicode
  scalar value.
- `normalized()` (Dart trim then simple lowercase): the native backup
  importer uses the identical `native_library::normalized`.
- Lowercase hex encoding: `spotiflac_core::lower_hex` replaces the per-byte
  `format!` collectors in data_jobs and network_tags, the signed-session
  `hex` and the `hex` arm of `binary::encode`; checked for all 256 bytes.
- ID3 syncsafe decode: the tag writer's `size` reuses the reader's
  `tags::id3::syncsafe`; checked across the 0x7F/0x80 boundaries per byte.
- Bounded body reads: `HttpStream::read_limited` replaces the read-to-limit
  loops of the lyrics HTTP client, the resolver HTTP client and the
  extension registry reader. Callers keep their buffer sizes (16 KiB,
  16 KiB, 64 KiB), their own error mapping and their messages; a loopback
  test compares it with the previous loop at and around the limit.

The mobile ID3 `synchsafe` is not merged: it validates the length and the
high bits and returns `None`, unlike the core decoder.
2026-10-19 00:36:29 +07:00
zarzet 088bd875dd refactor(core): move the lenient Go-style JSON decoder to core::json
The case-folding, null-tolerant struct decoder (`go_deserialize!` with
`field_name`, `KeySeed`, `Update` and `Field`) lived in `core::lyrics::json`
although downloads, metadata and resolver payloads depend on it. Move it
unchanged to a neutral `core::json` module and name the macro after its
behavior, `lenient_deserialize!`. All users are inside spotiflac-core, so no
compatibility re-export is kept. The lyrics module keeps only its
surrogate-normalizing `decode` helper.

`field_name` is now public so the extension registry decoder reuses it
instead of its own copy of the same folding. Its matcher folds the key once
and compares ASCII case-insensitively against the wire name, which a new
test checks against the previous matcher on edge inputs (empty, long s,
Kelvin sign, combining marks, non-ASCII letters, BOM, NUL).

The visitor's `expecting` text is unchanged so decode errors stay
byte-identical.
2026-10-19 00:36:29 +07:00
zarzet 42c90dbf62 refactor(network): split client.rs into pool, stream, headers and tests, and factor execute_stream
client.rs held the connection pool, the streaming response type, header
helpers, tests and a 274-line execute_stream in one 1220-line file (audit
RS-15). Move the self-contained parts into client/ and break
execute_stream into phase helpers so the redirect loop reads top-down.

Pure moves (verbatim apart from pub(super) on items the parent uses):
- client/pool.rs: Connector and Pool.
- client/stream.rs: ResponseBody and HttpStream (re-exported from client,
  so crate::HttpStream is unchanged).
- client/headers.rs: update_explicit_cookies, forward_sensitive_headers
  and canonical_header. error_chain stays in client.rs; it is not a
  header helper.
- client/tests.rs: the existing unit tests.

execute_stream helpers (base line ranges refer to main:client.rs). Each
body is the statements it replaces; the loop, await points, error
mapping, redirect limit and header mutations stay in the same order:
- prepare_request: 720-769, request validation, method, body, headers,
  user agent, default JSON content type and explicit referer, returned
  as PreparedRequest. Only the mut markers moved to the call site.
- outgoing_headers: 773-802, per-attempt cookie header and gzip
  negotiation, returning (outgoing, gzip). header(&url) became
  header(url) because url is now a reference.
- send: 803-845, the request, its 45 s header timeout and the native
  HTTPS-to-HTTP fallback retry. The permit is passed by value and
  returned, so drop(permit) still runs before the retry acquires a new
  one. matches!(method, ..) became matches!(*method, ..).
- redirect_target: 862-869, Location resolution, credential rejection
  and redirect policy validation, returning the target.
- release_redirect_body: 906-928, the 20 ms drain of a small HTTP/1.1
  redirect body.
- response_reader: 932-959, discard eligibility and gzip decoder setup,
  returning (headers, small_http1, reader).
- canonical_headers: 960-970, canonical response header map.

The redirect request rewrite (871-905) stays inline: it updates the
loop-carried method, body and headers and reads six other values, so a
helper would need nine parameters or a state struct that rewrites every
statement in the loop.

hyper is not a direct dependency, so the response type is named through
the pooled client's tower Service implementation (HyperResponse).
No public path or signature changes.
2026-10-19 00:00:04 +07:00
zarzet 12d422afa3 refactor(extensions): split manager.rs into install, lifecycle, info and tests modules
manager.rs mixed package install/upgrade/remove, the runtime lifecycle,
listing/info helpers and tests in one 1245-line file (audit RS-14). Move
each group into a sibling module under manager/, next to the existing
downloads, metadata, postprocess and providers modules:

- manager/install.rs: install, install_or_upgrade, stage, candidate,
  install_package, remove, upgrade, upgrade_package, check_upgrade and the
  install-only helpers error_from_rollback and remove_directory.
- manager/lifecycle.rs: prepare_with_lease, validate, lifecycle,
  lifecycle_with_lease, teardown_runtime, teardown, failed, ready and
  ready_with_lease.
- manager/info.rs: load_all, load_directory, installed,
  installed_versions, provider_ids, summary, asset and information.
- manager/tests.rs: the existing unit tests.

Method bodies are moved verbatim (whitespace-normalized token streams
match the base), so the engine, status and download pool lock order is
unchanged. Methods called from other manager submodules become
pub(super) because method privacy follows the module of the impl block.
No public path changes.
2026-10-19 00:00:04 +07:00
zarzet 380b5cb872 refactor(extensions): split backend/downloads.rs helpers into submodules and move its sibling tests
Move the prepared-download cache, metadata mapping, path building,
result matching and response envelopes into backend/downloads/ siblings.
The three #[path] test files become plain test modules next to them, so
test names are unchanged. download_attempt and the orchestration stay in
downloads.rs.
2026-10-18 23:40:19 +07:00
zarzet 1b2efc76cc refactor(extensions): split runtime.rs into control, vm and tests modules
Move Control and ControlWait, the worker loop and QuickJS VM, and the
unit tests into runtime/ siblings. ExtensionRuntime and the crate::runtime
paths used by the host modules are unchanged.
2026-10-18 23:36:13 +07:00
zarzet a6dda02396 refactor(lyrics): split native_lyrics into text, lrc, ttml, credits and tests modules
native_lyrics.rs kept only the shared types, has_usable_timing and the
execute entry point. Lexing and timing helpers move to text, the LRC
parser to lrc, the TTML parser and XML normalization to ttml, credit
extraction (with its regex statics) to credits, and the tests to
tests.rs. Function bodies are unchanged; only visibility on moved items
and use lines differ. The fixture include_str path gains one parent
segment for the new file depth.
2026-10-18 23:28:19 +07:00
zarzet 3f904004ff refactor(rust): move inline tests and the test-only hires decoder into submodules
Inline test modules of tags/write.rs, lyrics/payloads.rs and
extensions/src/files.rs become sibling tests.rs files, and the
cfg(test) reference decoder of media/hires moves into hires/reference.rs.
The artist-mode helpers of tags/write.rs move to write/artists.rs.
No behavior or public API change; the supplement_tests module of
payloads.rs is now named tests.
2026-10-18 23:28:19 +07:00
zarzet 8aca5e4ef2 refactor(android): drop unreachable dispatch cases and dead channel handlers
RustCoreBackend.invokeApplication handled readFileMetadata,
editFileMetadata and cancelNativeDataJob, but MainActivity intercepts
all three first: the metadata methods are in nativeBackendMethods and
dispatchBackendApplication answers cancelNativeDataJob before it calls
invokeApplication. No Kotlin code calls invokeApplication with those
names.

Dart never sends these channel methods, so their handlers go on every
platform:

- shareMultipleContentUris (Android) and getAvailableLyricsProviders
  (Android and iOS) have no Dart caller.
- scanLibraryFolderIncrementalFromSnapshot and
  scanSafTreeIncrementalFromSnapshot are called only from the Dart host
  branch of the library scan, which runs only when
  supportsCoreBackend is false, that is never on Android or iOS. The
  unreachable Dart wrappers are removed separately.

The allowlist and the when cases in MainActivity stay in sync (70
names). The UniFFI exports get_available_lyrics_providers_json and
scan_library_folder_incremental_from_snapshot were used only by the
removed handlers; the backend methods behind them stay.
2026-10-18 23:01:04 +07:00