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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
"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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Update settings, About, provider descriptions, and lyric source credits. Preserve the stored provider ID and recognize both current and legacy credits as direct sources.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.