Commit Graph
71 Commits
Author SHA1 Message Date
zarzet 652cd1736b feat(lastfm): add desktop account connection and scrobbling
Authorize Last.fm accounts in the system browser and store sessions in OS secure storage. Add desktop Playback settings for scrobbling and Now Playing, including localized status and recovery controls.

Observe the local full player, measure actual listening time across pause and seek, distinguish repeats and transitions, and persist qualified listens before submitting account-scoped batches. Keep previews and remote Link sessions outside submission.

Validation: 281 Flutter tests passed, analyzer and pinned formatter clean, workflow lint passed, macOS debug build succeeded, and the signed Last.fm API handshake was verified. Build credentials are supplied locally or through Actions secrets.
2026-11-01 20:50:03 +07:00
zarzet d125c50fac perf(storage): move preference blobs to atomic files
Keep Explore payloads and timestamps, autoplay learning, and release bodies with their validators in application-support snapshots. Serialize migration, replacement, metadata updates and clear across store instances. Flush and rename before removing legacy keys, retain data on failure, and use a tombstone to prevent clear from reviving old preferences.

Preserve full payload content and unrelated settings. Explore reads are asynchronous and report actual file length; delayed release revalidation updates current metadata without overwriting a newer body.

The 261281-byte host preference fixture drops to 21 bytes after migration. Sixty subsequent blob saves make zero preference writes, with only three initial removals. Migration, corruption, failure/retry, ordering and all three consumer paths pass scoped host tests.
2026-11-01 20:30:50 +07:00
zarzet 32672e1c39 perf(network): keep one Subsonic metadata client per connection
Each Subsonic or Mornye Link metadata read (getSong, then the cover and
lyrics in parallel) built a new HttpClient and force closed it, so every
song start paid one or two fresh TLS handshakes while streaming already
used a pooled client.

NetworkMetadataService now keeps one SubsonicClient per connection id
and reuses its keep-alive connections across reads. The client is reused
only for the exact saved connection (its JSON, so address, credentials,
API key and certificate pin), so an edit opens a new client and retires
the old one once its last read ends. It also closes after 20 s without
reads, when the connection is removed, on cancelPending, and after a
transport failure (anything but a Subsonic error, an HTTP status or a
local cache file error). Requests, headers, timeouts, certificate
pinning and redirect rules are unchanged, since every request still goes
through NetworkStorageService._request.

Measured on a local HTTPS fixture with a pinned self-signed certificate,
six metadata reads in a row: 6 HttpClients and 7 TLS connections before,
1 HttpClient and 2 TLS connections after, same 13 requests.
2026-11-01 19:21:10 +07:00
zarzet 836f0645a3 perf(player): set the AutoMix start timer again only when the start moves
While a mix waited, every 200 ms position tick cancelled the start timer
and created a new one: about 275 timers for the 55 s a one-minute song
waits, and up to about 725 for the 145 s a longer song now waits after
its lead. Positions follow the clock, so a tick almost always computes
the same moment. The timer is now set again only when the moment
computed from a new position moves by more than 20 ms, or when the
timer is no longer pending. A position that jumps or stalls still moves
the timer on the next tick, and the start itself re-checks the position
as before.

Host test (virtual time, the position following the clock): the start
timer is created 275 times for one song on the old code and once now;
the mix starts at 55000 ms in both.
2026-11-01 19:15:49 +07:00
zarzet be3b178c20 perf(player): prepare AutoMix only in the last 150 s of a song
AutoMix opened a second deck on the next song and decoded two analysis
windows (plus the native beat job) on the first tick of every song, so
each skipped song cost a full preparation that was thrown away, and the
prepared deck held an open decoder for the rest of the song. The owner
approved preparing only once 150 s remain. A plan starts within the last
minute (the longest fade), so preparation still has at least 90 s, and
a song of 150 s or less still prepares in its first seconds.

The plan does not depend on where preparation starts, so every mix
starts at the same moment with the same cue and rate. A seek already
cancels a prepared mix: a seek into the last 150 s prepares on the next
tick as before, and a seek back out now leaves no deck open until the
song returns to its last 150 s. A queue edit before then costs nothing.
The position predicate asks for the tick that crosses the lead.

Song analysis kept off the first 20 s of each song because AutoMix
prepared there. AutoMix now reports while it prepares, and both the
Library sweep and the playing song's analysis wait for it. The sweep
still avoids the first 20 s, where covers, lyrics and haptics load and
the playing song's own analysis follows.

Host tests (fake decks, virtual time): a session of four 4 min songs
skipped at 10 s and 60 s made 6 window decodes and 3 mix decks before
the third song reached its end; now none until its last 150 s, then 2
decodes and 1 deck. Mix start positions match the old code within 1 ms
(195000 vs 195001, 195670 vs 195671, 235000 both). Engine reads for a
200 s song: 827 instead of 990.
2026-11-01 19:15:49 +07:00
zarzet b52196410b fix(network): preserve edits and close late requests
Check the backup still matches the original before replacing a network file. Abort upload requests that open after timeout and prevent disposed sessions from recreating their HTTP client. Focused conflict and lifecycle regressions pass.
2026-11-01 19:11:44 +07:00
zarzet 18c95e8239 fix(player): preserve transport intent across asynchronous work
Bound position polling to one in-flight request and discard stale seek completions. Serialize exclusive-output changes without losing newer pause, stop, or dispose intent. Targeted playback and USB regressions pass.
2026-11-01 19:11:43 +07:00
zarzet e0f8ee6117 feat(network): edit metadata and lyrics on SMB and WebDAV
Enable the shared metadata, lyrics and cover editor for writable NAS songs on mobile and desktop. Stage complete files locally, preserve the original during publication, and reconcile failed or lost rename replies.

Refresh Library rows and player metadata after successful saves, retain artwork in the Library cache, and keep HTTP and generic Subsonic sources read-only.

Validation: 248 related tests passed, plus 31 UI regressions after the final mounted-state guard. Scoped analysis, formatting and git diff checks are clean.
2026-11-01 17:35:49 +07:00
zarzet a5e8077419 fix(link): keep Android phones available in the background 2026-10-31 23:56:12 +07:00
zarzet 8366eb3b89 perf(network): end a search3 sync only on an empty song page
The Mornye search3 sync treated a page shorter than 500 songs as the
last one, so a desktop that ever capped pages lower would have synced
a truncated Library to the phone. The offset now advances by the
number of entries each page returned and only an empty page ends the
catalog, at the cost of one extra request per sync (5 instead of 4 for
the 1,200-song fixture, 1 album page and 4 song pages).

A non-empty page that brings no new id still fails the scan, so a
server that ignores songOffset cannot loop or publish a partial
Library. Video ids count as progress, so a last page holding only
videos ends normally.
2026-10-31 22:07:30 +07:00
zarzet 4d53d7f75c perf(network): revalidate stale Subsonic covers with their ETag
The daily cover check downloaded every stale Subsonic cover in full
and compared it with the cached file byte by byte, although the Link
desktop (and many servers) send an ETag and answer If-None-Match with
304. The first rescan of a day fetched all 500 album covers of a Link
library at original size.

The ETag of a downloaded cover is now kept beside it in
<cover>.etag together with the image length. A stale check sends
If-None-Match; a 304 keeps the path and touches the modification
time, like an unchanged download did, without reading a body. A 200
follows the existing rules (same bytes keep the path, changed bytes
get a new path behind .current) and stores the new ETag. A forced
refresh, a validator for other bytes, older caches and servers
without ETags behave as before.

The validator survives restarts. The Library cover prune (Dart and
Rust) keeps it with a referenced Subsonic cover, as it keeps the
.current pointer, and the song metadata cover cache still keeps 32
covers, each with its ETag, instead of counting ETags as covers.
Older builds ignore the files and their prune removes them.
2026-10-31 22:07:30 +07:00
zarzet 3c4639797b perf(network): sync a Mornye desktop through search3 song pages
A Link rescan walked the desktop album by album: getAlbumList2 pages
of 200, then one getAlbum per album, all serial, so 500 albums cost
503 round trips. Every response of a Mornye desktop says
type "mornye", and its search3 with an empty query pages every song
with the same song objects as getAlbum (contract section 4).

The first getAlbumList2 page now decides: a Mornye desktop is read
through search3 pages of 500 songs (the isVideo filter, id dedup,
500,000 cap and "pagination did not advance" guard are kept), any
other server keeps the album walk with the same requests as before.
search3 keeps no album's songs together, so the scanner remembers
the cover of every cover id of the scan (up to 20,000) instead of
the last 128, and still asks for each cover once.

Fixture library of 1,200 songs in 120 albums: 4 requests (one album
page and three song pages) instead of 121, the same Library rows,
and 160 cover requests for 160 cover ids in shuffled song order.
2026-10-31 22:07:30 +07:00
zarzet afaaa999ac perf(link): push the desktop catalog only when its songs changed
Every export handed its catalog to the server, which bumps the version
and sends catalog.changed to every phone, and each phone then rescans
the whole desktop Library (NET-1). Most exports change nothing: each
return of window focus reloads history and bumps the Library revision,
and each phone song commit rescans that phone's source on the desktop,
whose network rows the exporter leaves out anyway.

The exporter now returns a SHA-256 of the song lines without the header
(generatedMs is new every time). The mapping isolate hashes each line
and the export hashes those 32-byte digests, so rows left out moving
page starts do not change it, and the UI isolate hashes about 0.6 MB
instead of the 14 MB catalog for 20,000 songs (about 4 ms instead of
95 ms on an M-series Mac). The digest covers every field the server
reads, coverPath and webCoverPath included, so a web cover copy that
arrives still reaches phones.

The host skips setCatalog when the digest equals the one the current
server read; the index, web cover prune and fetch, and phone source
rescans still run, and player.state is not re-sent for unchanged song
ids. Every started or adopted server counts as a new run, so a restart,
a rename or a server started while the last one took a catalog always
gets it.

Measured with the host tests: a Library revision bump that exports an
equal catalog calls setCatalog 0 times instead of 1, which saves each
connected phone a full rescan.
2026-10-31 01:04:45 +07:00
zarzet d60e13dca3 fix(link): use a web cover copy only for songs without a picture
Every default download keeps an https cover address and also embeds its
cover, so round 1 copied the web cover of every download and the
catalog's coverPath then outranked the picture in the file. The owner
approved web covers only for songs with no other cover.

The exporter now reports each song without a local cover file but with a
public https cover (path, path+mtime+size stamp, address) and names a
copy only for a song whose file is known to embed no picture. The store
asks linkEmbeddedPictures about new file versions in batches of 64 on
the Rust worker pool, keeps the answers in pictures.json, keeps the
copies a song may still want, fetches only for songs known to embed
none, and announces a held copy a newly asked file can take.

Also from the review: the host stops the store only after the server
stopped, so an export finishing meanwhile fetches nothing; web cover
fetches take https only, refuse localhost and loopback, link-local and
private literals, check every redirect by hand and end after a minute;
once the store is full it fetches and retries nothing until a prune
frees space; a failed write removes its staged file. Phone covers keep
their fetch unchanged.
2026-10-30 19:41:42 +07:00
zarzet 48f8e85881 fix(link): serve desktop web-only covers from a lasting Link folder
A desktop download saved without embedded metadata has only an https
cover. The catalog left coverPath empty for it and the server answered
getCoverArt with 404, so the phone showed a placeholder while the
desktop showed the web cover.

LinkWebCovers keeps one copy per address in <app support>/link_web_covers
(<linkCoverUrlId(url)>.<ext>), fetched with the phone covers' fetch,
image check and staged write, now shared from link_web_covers.dart.
Each export lists the copies held and names them as coverPath; songs
with a local cover file and the desktop identity index are unchanged.
Once the server has loaded a catalog, the host removes the copies no
exported song wants and fetches the missing ones in the background,
4 at a time, with a byte cap and a timeout; failures wait 1 minute,
doubling up to 6 hours. New copies schedule an export, whose
catalog.changed makes phones rescan and fetch the cover.

A catalog only names files that exist, so Rust needs no change and an
album never prefers a copy that has not arrived. The listing an export
starts with waits for a queued removal, and removals run only after
setCatalog, so no file the server names is removed.
2026-10-30 19:41:42 +07:00
zarzet 08d524eba4 fix(covers): keep a Subsonic cover path while its image is unchanged
The daily check rewrote subsonic_<hash>.image in place when no .current
pointer existed, so decoded sizes and the home-screen widget key kept
showing the old image after the server changed it. A forced refresh went
the other way and moved even an unchanged image to a new path, which
dropped every decoded size and rewrote Library rows for nothing.

The fetched bytes are now compared with the published file: the same
image only updates the modification time and keeps its path, a changed
image always gets a new path behind the .current pointer.
2026-10-30 17:47:54 +07:00
zarzet 05a5d94834 fix(link): keep phone covers until the Library stops showing them
When a phone committed a new song list, the desktop deleted every stored
cover the new list did not name right away, before the rescan of the
phone's Library source had moved the rows off them. Songs whose cover
changed (a phone rescan changes every cover id) showed placeholders until
the rescan finished, and longer when the rescan waited behind another
scan.

A commit's removal now also keeps covers the phone source's Library rows
name (LinkPhoneLibrary.coverPaths, read from the library table) and skips
deleting anything when those rows cannot be read. It is queued right
behind the last page, so it runs after the commit reply and before
anything the phone sends next. A cover kept only for rows goes at a later
commit, or at the next GET phone/catalog (the start of a sync) when it is
older than the committed list; covers sent since that commit wait for the
commit they were sent for, so a sync that stopped halfway does not upload
them again. GET phone/covers waits for the removals queued before it, so
the phone never skips a cover that is deleted right after it was listed.
The other cover readers look up covers of committed songs, which no
removal takes away, so they answer at once and never wait behind a web
cover download. Web cover fetches stay a separate queued step. The 1 GiB
store limit and the cover ids are unchanged.
2026-10-30 07:42:07 +07:00
zarzet a73f63772d chore(deps): update Flutter, native and Rust dependencies 2026-10-30 01:29:33 +07:00
zarzet a940b07911 fix(link): recover discovery after network changes
Refresh discovery when interfaces change or the app returns to the foreground. Retry failed and unexpectedly stopped browsers with bounded backoff, and report Bonjour policy denial as a local network permission failure.

Validation: 82 related tests pass; targeted analyzer and formatting checks pass. Two Devices handoff tests also fail on the unchanged baseline.
2026-10-28 23:55:15 +07:00
zarzet c2db8ab4b6 feat(player): gapless playback
The next song used to load only after the current one ended, which
left a short silence between songs. With Gapless playback on (the
default), the player loads the next song on a second deck 30 seconds
before the end and starts it the moment the current one completes.

The decks gain setNextDeck. The Android fork links its players with
MediaPlayer.setNextMediaPlayer, so the platform starts the next song
itself; the Darwin fork resumes the linked player first thing in its
end-of-item handler, prerolled when linked. libmpv decks cannot hand
over their output, so on Windows and Linux the loaded deck starts on
the completion event.

AutoMix replaces gapless playback while on, and repeat one, USB
bit-perfect and exclusive output keep the ordinary transition. A queue,
shuffle, repeat or settings change, a pause, a stop or Previous drops
the prepared song; a seek keeps it. Playback settings gain the switch,
which the settings search finds as well.
2026-10-27 00:08:16 +07:00
zarzet 72d9b4c26d feat(link): run song transfers on the desktop
The desktop accepts transfers/offer from a phone and saves the offered
songs one transfer at a time into the download folder as Mornye Link
downloads, skipping songs it already has. It offers its own songs to a
phone, follows the phone's status, and fails a phone's transfers when it
disconnects.
2026-10-26 01:14:03 +07:00
zarzet b6f94ccef3 fix(link): sync playback modes and restore queue covers
Carry autoplay, AutoMix, repeat and shuffle across handoffs, synchronize active desktop preferences with the phone, and retain the queue order when adopting shuffle.

Recover visible queue artwork through the shared embedded-cover cache and protect phone uploads with background work leases.

Validation: 443 related tests passed; analyzer, formatting and diff checks passed.
2026-10-25 23:36:03 +07:00
zarzet 2b33e607b2 feat(link): show a paired phone's songs in the desktop's Library
The desktop keeps each paired phone's song list and covers from the
phone/catalog and phone/covers ops under link_phones/<sourceId>, adds
the phone's network:// Library source once after a commit and rescans
it, and removes both when the phone is unpaired. Scans leave out songs
the desktop already has. A phone song plays from its received file, or
asks the connected phone with files.request and streams the upload once
files.sending arrives; tag reads wait for it, else answer the stored
fields.
2026-10-25 16:58:21 +07:00
zarzet ac31cd1d64 fix(link): keep a phone's song list until its Library changes
The phone keeps the last list it built with the Library revision it came
from (downloads and Library index versions, the Local Library switch). A
new connection reuses it and only compares versions with the desktop; the
list is built again only after the revision changes. A file request for a
name the list lacks still builds again once per change.

Scanned songs are dated by the file's modification time, since a full
rescan stamps every row with a new scan time, so a rescan of unchanged
files keeps the list's version. Covers are read and encoded in an isolate,
one request at a time, within the 1 MiB and 4 MiB limits.
2026-10-25 16:58:21 +07:00
zarzet bb7762952d feat(link): build the list of a phone's songs for the desktop
Pages the Library Songs rows the phone shows and keeps local files and
content URIs in a format the desktop takes, with the file ids Play on
desktop gives the same files. Builds the list's version, the file behind
each song for later uploads, and the covers of at most 1 MiB. Rows are
mapped off the UI isolate a page at a time.
2026-10-25 16:58:21 +07:00
zarzet 8e7d792c29 feat(playback): exclusive output on Windows, macOS and Linux
Add a desktop "exclusive output" option that takes the output device for
the music player alone, bypassing the system mixer. It always plays
through libmpv:

- Windows: WASAPI exclusive mode, with ao-reload when the option changes
  mid-track.
- macOS: AVPlayer cannot play while the app holds Core Audio hog mode, so
  macOS bundles libmpv (media_kit_libs_macos_audio, through CocoaPods)
  and ExclusiveOutputDeck moves the player from AVPlayer to a libmpv deck
  with audio-exclusive while the option is on, reopening a playing track
  where it was. Turning it off disposes that deck, releasing the device.
- Linux: an ALSA hw: device opened directly, chosen from /proc/asound or
  the first card.

A refused or busy device reopens the track in shared mode at the same
position and the settings page reports it. AutoMix and previews stay off
while the option is on.
2026-10-25 15:45:49 +07:00
zarzet d41731fb69 fix(link): keep the notification on the desktop's song in the background
The phone closed its session with the desktop in the background, so
Next and Previous from the notification reached the desktop but the
song it moved to never came back, and the notification kept the old
one (Pause looked right only because it is shown before the desktop
answers). The session now stays connected in the background while the
desktop plays in the phone's place.
2026-10-25 14:13:37 +07:00
zarzet 12f04d239e feat(network): show lyrics for songs on a Subsonic server
Songs from a Subsonic server, which includes a paired desktop, read
their tags from getSong, which carries no lyrics, so the player offered
an online search even when the file had lyrics. The tag read now also
asks getLyricsBySongId and keeps the stored text a Mornye desktop sends,
else rebuilds LRC from the synced lines. Servers without the extension
keep working as before.
2026-10-25 14:05:49 +07:00
zarzet 74188a5c98 fix(player): play the song again when Android's media server dies
Android restarts its media server shortly after it dies, which failed
the playing song with MEDIA_ERROR_SERVER_DIED until Play was pressed
once or twice. The player now reloads the song where it was, up to two
times half a second apart, before reporting the failure.
2026-10-25 13:46:57 +07:00
zarzet 931386dfe6 fix(link): keep playback usable while the desktop is out of reach
A failed connection attempt now moves playback back to the phone, so
songs picked meanwhile no longer wait for a desktop that cannot answer.

A new song abandons a source still preparing on the phone's player
instead of queueing behind the plugin's 30 second prepare timeout, so a
local song plays at once after a network song that hangs.

While the session cannot reach the desktop its Library songs check the
server with a short connect before playing and fail within seconds
instead of waiting the 20 second network timeout.
2026-10-25 13:02:11 +07:00
zarzet b4b66fcca3 feat(link): start a phone-only song on the desktop while it uploads
Play on desktop no longer waits for the whole file. The phone posts
handoff/play once the bytes up to the resume point and a 512 KiB margin
are sent (all of them for an MP4 whose index follows the audio), naming
the upload in `arriving`; the rest uploads in the background, and later
songs wait for it.

The desktop serves an arriving file over loopback HTTP with Range
support, reading the part file as it grows, and the player opens that
URL through MusicPlayerRuntime.streamWhileArriving until the file is
whole. The queue entry keeps the final path, and the embedded cover is
read once the file lands. On Windows the Rust rename into place is
retried briefly, since an open reader blocks it.
2026-10-25 06:20:59 +07:00
zarzet f9519894d4 feat(link): drive the desktop queue, notification and uploads from the phone
While the desktop plays in the phone's place:

- Reordering or removing queue rows edits the desktop queue through new
  `move` and `remove` commands, applied on the phone at once. Queue rows
  are distinct objects so a song queued twice keeps separate rows.
- The system media session switches to a RemoteMediaSession through a
  SwitchAudioHandler: the notification, lock screen and headset show and
  drive the desktop. Car browsing stays local, and a Library song picked
  in the car plays on the phone and hands the session back.
- Picking a song only the phone has shows "Sending this song to
  (desktop)..." with its upload progress in Now Playing and the mini
  player.
2026-10-25 05:56:55 +07:00
zarzet 91c1e49d79 feat(link): one player on the phone for both devices
After Play on desktop, Now Playing, the mini player, the queue and the
volume slider show and drive the desktop instead of a second player in
the Devices sheet, so lyrics and song details work for desktop playback
too. A desktop track shows as the phone's own file when it has one, else
as the desktop song with its cover. Songs picked or queued on the phone
meanwhile play or queue on the desktop (new queue/add op), uploading the
ones only the phone has.

The Devices sheet becomes a device picker: This phone or the desktop,
with the one that plays checked and inert, so tapping it again no longer
restarts the handoff and rewinds. The phone takes over again on Continue
on this phone, on unpairing, and when its own player starts.
2026-10-25 05:36:46 +07:00
zarzet 68bfd7624d feat(link): play the phone's own songs on the desktop
Play on desktop used to skip songs only the phone has. The phone now
asks the desktop which songs it lacks, uploads the current one first
(PUT /mornye/v1/files/<id>.<ext>, streamed to <app support>/link/received
and pruned to 4 GiB) and starts the desktop there. Later songs follow in
the background and handoff/append adds them in order.

getCoverArt also serves covers embedded in the audio file, so downloads
whose cover is only in the file no longer show up on the phone without
one.
2026-10-25 05:14:35 +07:00
zarzet f463425ef0 fix(link): show desktop addresses as sent and group the phone's code
The server already sends https URLs, which the desktop page wrapped
again (https://[https://...]:47710). The phone now groups its security
code like the desktop (ab12 cd34) so the two read the same.
2026-10-25 04:01:54 +07:00
zarzet f580b5c46c Merge branch 'link/l2-desktop' into link/integration
Both settings entries are kept (computer on phones, phones on desktops).
The desktop's 'nothing playing' string for a connected phone becomes
linkDesktopPhoneNothingPlaying, since the phone sheet already uses
linkDesktopNothingPlaying with a name. The desktop host now registers
the sync handlers and announces collection changes to phones.
2026-10-25 03:28:13 +07:00
zarzet 94a016a9fc feat(link): run the Mornye Link host on desktop
Add the Dart side of the desktop link server: bridge calls and inbound
events for the link backend, a keep-alive host service that keeps the
enabled flag and device name, starts and stops the server, answers
forwarded requests through the shared router and pushes player and
download changes to connected phones.

The catalog exporter pages the Library Songs rows, maps them off the UI
isolate to the NDJSON catalog and builds the identity index the router
features resolve tracks with. The L2 ops cover player state, commands,
handoff, downloads, open, resolve and the Subsonic play queue.

The macOS app declares local network use and the Bonjour service.
2026-10-25 03:25:02 +07:00
zarzet 192b75e4ef Merge branch 'link/l3b-features' into link/integration
# Conflicts:
#	lib/app.dart
2026-10-25 03:00:18 +07:00
zarzet 12786a146c feat(link): add phone features for a paired desktop
Build and resolve TrackRefs (ISRC, match key within two seconds, title
and artist, then the desktop stream), hand playback over in both
directions, report the phone player as player.state and obey desktop
commands and open messages, queue downloads and links on the desktop,
and save desktop songs to the phone as Library downloads.
linkPhoneFeaturesProvider runs for the app's lifetime from MornyeApp.
2026-10-25 02:59:03 +07:00
zarzet 7e294724ea feat(link): download original Subsonic files and decode song paths
Add SubsonicClient.download, which saves a song's original file through
the pinned connection with progress and cancellation, and the
subsonicSongPath/subsonicSongIdFromPath helpers that map scanned network
rows to catalog ids.
2026-10-25 02:59:03 +07:00
zarzet 68dd11bf55 Merge branch 'link/l3a-client' into link/integration 2026-10-25 02:38:02 +07:00
zarzet 32fc942a04 feat(link): add the phone client for desktop discovery and pairing
Phones find Mornye on a computer over mDNS (bonsoir, _mornye._tcp),
pair with its 6-digit PIN and keep a live session with the chosen
desktop.

- Pinned HTTPS: first contact records the presented certificate and
  checks it against info and the mDNS fingerprint; later requests and
  the WebSocket accept only that SHA-256.
- Pairing posts the PIN proof, maps bad_proof, pairing_closed and 429
  to clear errors, saves a Subsonic API-key network connection, adds it
  to Library and scans it. Re-pairing replaces the key in place.
- LinkClientSession: Bearer JSON get/post with timeouts and
  LinkException mapping, WebSocket hello/welcome, backoff from 1 s
  doubling to 30 s, pause in the background, reconnect when discovery
  sees the desktop again, address updates when it moves.
- LinkClientController publishes the active session through
  linkActiveClientProvider and rescans on catalog.changed.
- Settings entry "Mornye on your computer" on Android and iOS with
  nearby and paired computers, PIN and manual address dialogs, forget,
  and local network permission, Wi-Fi and certificate warnings.
- iOS NSBonjourServices and the Android multicast permission.
2026-10-25 02:37:07 +07:00
zarzet 6cbfcf8248 feat(link): track collection and listening changes for sync
Collections schema v3 adds link_sync_state and link_sync_changes with
SQLite triggers on every collection table, so Dart, native publication
and restore writes are all recorded, one coalesced row per key with
tombstones. Existing rows are seeded on upgrade. Native jobs keep
reading and staging v2 copies of the collection tables.

Listening statistics v2 adds per-author running totals with a stable
(origin, day, track key) id. Stores page changes by cursor and apply
peer changes by last writer wins without echoing them as local.
2026-10-25 02:34:45 +07:00
zarzet 6eaffa5942 test(search): cover the wide result layouts and pin the phone rows
The narrow suite compares what the Search tab paints on phones, a
landscape phone, a portrait tablet and a narrow desktop window, in both
styles, against fingerprints recorded on the previous layout. The wide
suite covers the cover grid (tap, cover saving, sort, keys, RTL), the
All view songs and shelves with their Show all controls, the desktop
song table activating like a phone row, and skeleton geometry.
2026-10-24 10:36:50 +07:00
zarzet d407d8b374 chore(library): remove the test-only collections map export
Backups embed the worker JSON fragment from exportLibraryCollectionsJson, so
the map export mode and its benchmark only served tests.
2026-10-23 22:43:23 +07:00
zarzet b696d38e75 chore(library): remove test-only single-item collection mutators
Production removes wishlist, loved, playlist and playlist-track entries through
the batch paths. Device benchmarks now use the production one-item calls as
their per-track baseline.
2026-10-23 22:43:23 +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 fa2f73160b feat(network): add Subsonic and OpenSubsonic support 2026-10-23 03:15:19 +07:00
zarzet bcb1ee8b90 feat(desktop): play through media_kit with MPRIS and SMTC sessions
Windows and Linux now create a libmpv deck through media_kit; macOS,
Android and iOS keep audioplayers. Without libmpv the runtime falls back
to audioplayers.

- The equalizer becomes one libavfilter graph behind mpv's lavfi filter
  (input gain, peaking bands, balance, compressor, -0.5 dBFS limiter)
  after a planar float conversion. Changes set the af property again.
  Filters a libmpv build lacks are probed once and left out; the input
  gain then moves to mpv's volume. Filter failures are reported per player.
- Deck volume is scaled by the in-app output volume on mpv's cubic curve,
  position updates run on a timer, DSD sources throw when libmpv cannot
  open them, and exclusive output has a hook for a later setting.
- The in-app output volume persists across launches on every desktop OS.
- Previews go through the runtime's preview deck, so desktop previews
  follow the in-app volume.
- Linux publishes MPRIS over D-Bus and Windows uses SMTC through
  smtc_windows, both driven by the audio handler.
- The Linux CI job installs libmpv-dev.
2026-10-20 16:55:01 +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