14 Commits
Author SHA1 Message Date
zarzet c4b7b57457 feat(link): sync song lyric offsets with the sound settings
Song offsets travel as a new songLyricOffset item kind of the sound
settings exchange while Sync sound settings is on. The newest edit wins
per song, dated by when it was set rather than when a sync noticed it,
and a song put back in sync is a tombstone. Both devices keep every
song's offset whether or not they have the song.
2026-11-17 03:09:17 +07:00
zarzet e64b36abf1 feat(link): sync saved sound settings between phone and computer
Equalizer presets the user made, the volume normalization level and
mode, and the shape of AutoMix transitions travel both ways over one
forwarded operation, POST /mornye/v1/preferences: the phone sends every
item it holds, the computer merges them and answers with every item it
holds. Last writer wins per item and deleted presets stay as tombstones,
so two devices editing different presets both keep their edits and a
deleted preset does not come back. The computer sends
preferences.changed when its side changed.

The phone syncs on connect, after a local edit and on that notice, only
while its sound sync choice is on. Live state (the curve playing now,
on/off switches, volume, speed) and device-specific values (the lyric
timing offset, outputs) stay on each device.
2026-11-17 03:09:17 +07:00
zarzet 6fff5fd136 fix(link): show playlist covers a synced playlist cannot load
A playlist synced over Link carried the file path of each song's cover.
That path names a file of the device that made the playlist, so the other
device showed the placeholder on the playlist tile, the page header and
every row.

Sync now sends web covers only and drops a path an older build still
sends. For playlists already synced, a stored cover this device cannot
load is answered by the same song in the Library: on the playlist tiles,
the playlist picker, the page header, phone rows and the desktop table,
which had no Library fallback at all.
2026-11-15 23:33:42 +07:00
zarzet 20e5b550d9 chore: neutralize UI terminology and clarify code comments 2026-11-04 22:53:56 +07:00
zarzet 0640617e47 fix(link): exchange missing listening statistics covers 2026-11-01 00:41:37 +07:00
zarzet 9ea69df77d perf(link): match unmapped history songs in batches
Applying a peer's listening totals looked up each song this device has
no key for with its own awaited query inside the statistics write
transaction (DATA-11). A first sync of a year of listening, about 3,000
songs, made about 3,000 sequential round trips while holding the write
lock the 10 s listening flush waits on.

The songs are now looked up 200 at a time with a VALUES list and the
same correlated query per song (NOCASE title and artist, newest day
first, first row), so each keeps the key it got before. The lookups
still run before the batch writes, against the same totals. Songs
without a title no longer query at all; they keep the author's key as
before.

Measured on the host (FFI, isolate, M-series Mac): 3,000 lookups took
237 to 2,016 ms one at a time and 8 to 111 ms in batches, with identical
results; the new test's apply reads 7 statements instead of 459. The
plan still searches idx_listening_title_artist per song.
2026-10-31 01:04:45 +07:00
zarzet 312b1340ad fix(link): keep a song's network cover when a peer's edit comes back
Collection songs go out without their network:// cover, so a change
the peer authors for such a row comes back without one. A desktop
playlist reorder restamps every member, and saving a Loved song again
rewrites it; applying either replaced the phone's row and dropped the
reference for good. Before F2 the phone's store path made the same
round trip and came back unchanged.

apply now reads, inside its transaction, the rows that winning Loved,
wishlist and playlist song changes without a cover replace, and keeps
a network:// cover they hold. A cover the peer sends still wins, and
the reference still never leaves the device. Every collection receive
path (the phone's pull, the desktop's POST, the full exchange after a
replaced database) applies through this method.
2026-10-30 18:55:58 +07:00
zarzet 482206b404 fix(link): sync collection songs without network cover references
A network:// cover names a connection of the device that saved it, so
it means nothing on the peer. Loved, wishlist and playlist entries now
go out without one; the author's own row keeps it. Other covers are
sent unchanged, so existing rows sync exactly as before.
2026-10-30 18:55:58 +07:00
zarzet b7e18461eb refactor(link): keep the sync protocol free of the cover store
The history sync wire format imported cover_store.dart, with
path_provider and the network storage service, for one loopback check.
The check is now isLoopbackHost in cover_art_utils.dart, which both
durableCoverReference and linkSyncRemoteArtwork use. Same results.
2026-10-30 16:09:33 +07:00
zarzet bb7dd1e833 fix(link): sync no loopback artwork from older statistics
History sync sends artwork as http(s) URLs, and statistics rows from
older builds hold loopback URLs of the author's cover proxy. A first
sync with a new peer copied those into the peer's statistics, where
they name the peer's own loopback server instead. Sent and received
artwork now drops loopback URLs, so peers store none.
2026-10-30 15:46:59 +07:00
zarzet 9c435c4573 chore(link): drop an unused import from the sync protocol 2026-10-25 02:39:04 +07:00
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 0b406d5f1f feat(link): sync collections and history between phone and desktop
registerLinkSyncHandlers answers the collections and history endpoints
and the Subsonic playlist, star, getStarred and scrobble ops on the
desktop, and announces changes through linkCollectionsChangedHookProvider.
linkSyncRunnerProvider keeps the phone in sync on connect, on
collections.changed and after local edits, with per-server cursors.
2026-10-25 02:34:45 +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