120 Commits
Author SHA1 Message Date
zarzet d6f8ffbb9c fix(link): keep Play together through the follower's song end
The state of a song that ran out still carries the last position read
while it played, which can lie well before the listed length. A phone
that followed then took its own move to the next song for one picked by
hand and ended the session (seen on a real run with the computer
leading). The report now places a finished song at its end, and a phone
that ran out of its song is no longer logged as paused by itself.
2026-11-17 09:40:22 +07:00
zarzet e94a6aa4a2 fix(link): do not pause Play together when a song runs out
Between a song's end and the start of the next one a player reads as
neither playing nor paused. The phone took that for a pause, so at each
song end the follower was paused and rejoined about three seconds into
the next song (seen on a real run with the phone leading). A device that
reads as stopped within the last moments of its song is now given the
transition wait before a cue goes out.
2026-11-17 09:40:22 +07:00
zarzet edd8666fe3 feat(link): show Play together in the computer's Devices
The computer gave no sign that it played together with a phone, and its
Devices sheet still offered the usual choices, which would have moved
the queue under a running session.

While a session runs, the sheet shows a checked Play together row naming
the phone, no device is checked, and choosing this computer or that
phone ends the session there: the computer tells the phone, which stops
the device that was not chosen. This works whichever device owns the
queue. The player bar's Devices button names Play together and, in the
Material style, draws primary.

The row opens and closes with the reveal the phone's timing group uses,
now one widget. With reduced motion it no longer runs a size animation
of no length, which failed inside its own layout.
2026-11-17 09:40:22 +07:00
zarzet e18efec8f5 fix(link): log a Play together check every few seconds, not each one
Three check lines a second filled the 500 entry log within three
minutes and pushed everything else out of it. A line is written once a
second while a nudge runs or the players settle, and every five seconds
otherwise.
2026-11-17 05:10:57 +07:00
zarzet 276f91bfb7 fix(link): plan Play together nudges with what rate changes cost
The computer lost about 24 ms on every AVPlayer rate change, so a nudge
for 49 ms ended near 48 ms again and the aligner nudged every 4 s for
the whole session. The aligner now measures what each nudge's two rate
changes cost and plans the next one with it, lets a nudge run its course
(replanned once from a settled check, at the same rate), ignores checks
for 1 s after a rate change, and leaves errors inside the band alone
where the cost is larger than the band. When planned nudges keep
missing, it holds: no nudge until the drift passes 80 ms.

After a cue the lead now takes the whole settled offset, from two checks
that agree, instead of 60 % of the first one.

Each check logs the follower's reported and expected position, drift,
rate and nudge state at debug level, and each nudge's end logs the drift
before, expected and measured at info level.
2026-11-17 04:37:14 +07:00
zarzet 35de9e7ca4 fix(link): say whether the computer leads or follows in the start log 2026-11-17 04:37:14 +07:00
zarzet 5162ddec78 fix(link): keep a Play together nudge running without a rate change
A nudge at the rate already in force only moves its end, and one nudge
rate goes straight to the other. Each rate change costs some engines
time, so going through 1 in between cost it twice.
2026-11-17 04:37:14 +07:00
zarzet 722566c109 fix(link): extrapolate a Play together report at the rate in force
A report now carries the player's rate, so a nudged follower's position
is advanced at 1.02 or 0.98 rather than at 1 between its reading and the
check. A device that does not send it is read at 1, as before.
2026-11-17 04:37:14 +07:00
zarzet 7a3bc64391 fix(link): do not keep a song this phone already has from elsewhere
A kept playlist only knew the copies it had saved from the same device.
With a second device sharing the same songs, every one was copied again
beside the first copy. A download of the same song, or a copy saved
from another device, now counts as kept while its file exists.
2026-11-17 03:09:30 +07:00
zarzet da46092634 feat(link): share a phone's storage access songs with other phones
The catalog now takes a phone's Android storage access documents from
their Library rows without opening them, so browsing, streaming, covers
and copying reach every song of its own the app can play. A phone host
lends each one to its Link server through the playback descriptor lease
and returns it when the server closes it, also when the close arrives
during the open, and returns every lease once the server stops. Network
storage and Link devices' songs stay out.
2026-11-17 03:09:29 +07:00
zarzet f75f8d3e15 fix(link): do not report a dropped handshake as a changed certificate
A host that stops while a phone is connecting ends the TLS handshake
without presenting a certificate. Every TLS failure was reported as the
host showing another certificate, so the phone warned that the device
was not verified and offered to pair again. Only a refused certificate
is reported that way now; a handshake that broke off counts as a host
that cannot be reached.
2026-11-17 03:09:29 +07:00
zarzet ad86633136 feat(link): host Link on a phone while it is open or playing
With sharing on, the phone runs the same host as the computer through
the Link channel and announces it with the platform's service
discovery. It runs while the app is in front or plays, stops after a
short grace in the background (at once on iOS), and leaves out
downloads, opening links and file changes. Sharing is off by default.
2026-11-17 03:09:29 +07:00
zarzet 9b17fd2c61 feat(link): offer only what the Link host announces
Hosts announce their platform and optional features (downloads, opening
links, file changes). The phone remembers them and hides the actions a
host lacks, and shows a phone icon for a phone host. Older hosts that
announce nothing keep every action.
2026-11-17 03:09:29 +07:00
zarzet ed5ae32067 feat(link): Play together in the Devices sheet
A Beta entry next to the two devices starts it; choosing one device ends it there. The controller shares the queue, starts the session, keeps the connection, ends quietly when it drops, and remembers a phone timing shift per paired computer, set with a slider shown while it runs.
2026-11-17 03:09:18 +07:00
zarzet 6acc001fe5 feat(link): Play together coordinator and computer host
The phone measures the clock offset, mirrors the leader's song, play state and position to the follower, and corrects drift. The computer answers the together ops, follows cues and reports its own pause, play, skip or a new queue. A simulated room with two players tests start, ten minutes of drift, transport, gapless song ends, a missing song, the timing shift and a lost connection.
2026-11-17 03:09:17 +07:00
zarzet bbe5e6e187 feat(link): Play together timing core
Adds the together ops and reports, the deck over the shared player interface, the aligner that leaves small errors alone, nudges the follower's rate or rejoins, and learns the start lead, and the follower that starts at an agreed instant. A simulated deck with clock offset, drift, latency and jitter backs the tests.
2026-11-17 03:09:17 +07:00
zarzet c42c62c011 feat(link): start a queue paused and override settings for a session
setQueueAndPlay takes startPaused so a waiting queue loads without a sound, prepareQueueItem loads an entry without starting it, and the runtime can apply a settings override that is never saved. Play together needs all three.
2026-11-17 03:09:17 +07:00
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 4df0c40842 feat(link): save kept collections to the phone by themselves
A playlist or Loved marked as kept on this phone has its songs from the
paired computer saved here through the existing saver and Transfers when
the computer connects, when a kept collection gains or loses a song and
when a collection is newly kept. Runs are debounced and one runs at a
time; only songs the saver does not already have are queued, nothing is
deleted, and failed songs wait for the next connection or change. The
marks live in SharedPreferences on this phone only.

The receiver's save takes an onFinished callback with the last status,
and the saver exposes its already-there check as has().
2026-11-17 03:09:17 +07:00
zarzet 45d4c2d411 chore: remove redundant comments and unused import 2026-11-17 02:05:45 +07:00
zarzet d2669d13c4 feat(convert): choose the resampler quality with a slider
A lossless conversion that changes the sample rate could only pick SWR
or SoXR, each at one fixed setting. Add a quality slider under the
resampler choice, moved by dragging or by a tap anywhere on its track,
with the level named beside it and what it uses below.

SWR offers Fast, Medium, High, Very high and Best (16, 32, 64, 128 and
256 filter taps; the two highest also raise the Kaiser window's
rejection). SoXR offers Medium, High, Very high and Best (16, 20, 28 and
33 bits of precision; 20 and 28 are SoX's HQ and VHQ recipes).

The defaults are what a conversion used before: the library's own SWR
filter (Medium) and the most SoXR offers (Best). A conversion sent to a
paired computer carries the level; one from an older phone gets the
default.
2026-11-16 18:38:13 +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 293cecb2d7 feat(network): optional SMB3 encryption for SMB connections
SMB sessions already negotiate the highest dialect the server offers,
up to SMB 3.1.1, but never asked for encryption, so a server that
requires it refused the connection.

The SMB connection form has an "Encrypt connection (SMB3)" switch. With
it on, the session is sealed and negotiates SMB 3.x only. Shared
folders cannot be listed over an encrypted session, so the address has
to name the share.
2026-11-11 23:29:21 +07:00
zarzet 702063d27a fix(link): follow the computer's audio when showing its lyrics on a phone
A phone showing what the paired computer plays restamped each player
state with the time it arrived, because the two clocks may run seconds
apart. The time the state spent on the way was lost, so the position,
and the lyrics with it, trailed the computer's audio by the network
delay, often a fraction of a second over Wi-Fi.

The phone now measures the computer's clock from its `GET state`
replies, stamped halfway through each round trip, keeping the sample
with the shortest round trip. Pushed states move onto the phone's clock
by that offset. A few pushes read the clock again until three samples
exist, then once a minute; reconnecting starts over. Before any sample,
or for a stamp over 5 s old, a state counts as read when it arrived.
2026-11-08 05:34:45 +07:00
zarzet 163b0a5b8d fix(link): download phone requests with a service this computer has
An album or playlist sent from the phone carried its metadata provider as
the download service. When that extension has no download provider on the
computer, every queued song failed at once with "Song not found on any
service". The computer now uses the hint only when it is an enabled
download provider there, like the phone's own download picker, and
otherwise its default download service.
2026-11-08 03:04:51 +07:00
zarzet 3c20cac699 feat(files): remove the folders a deleted song leaves empty
Deleting songs from the app left their album and artist folders behind,
so people had to clean them up with a file manager. The song's own .lrc
and .mlrc files stayed too, which kept those folders from being empty.

Deleting a song now also deletes its .lrc and .mlrc files, unless
another song in the folder has the same name. Settings > Files >
Existing Files gains Remove Empty Folders, on by default: once a song is
gone, the folders it leaves empty are removed, up to but never including
the download folder or a Local Library folder, and never a storage,
volume or home folder or a folder right inside one, such as Music or
Download. A folder still counts as empty when it only holds system index
files, Mornye's cover.mp4 or lyrics files of songs that are gone.
Folders are removed while the download queue is idle, so a download
never loses the folder it writes into.

Every place that deletes a song from the library goes through this:
the library and album screens, song details, Duplicate Review and
Mornye Link. Android storage access folders work through two new
platform calls that find a song's folders before it is deleted and list
a folder. Network songs and CUE tracks are only deleted, as before.
2026-11-08 02:43:14 +07:00
zarzet 2beb2b2cf6 feat(link): hide a device's songs while it is not connected
A paired device's songs need it connected, so the Library now hides
them once it has been disconnected for 10 s and shows them as soon as
it connects again: a phone's songs on the desktop, a computer's songs
on a phone. The device's Library source is marked unavailable, which
the visible library view already hides, and its status reads "Not
connected". In a phone's background no grace runs; resuming starts a
fresh one, so an iPhone dropping the link on purpose changes nothing.

Other network sources keep their state through outages, reconnect
scans skip network sources (Link refreshes its own songs), and a
connecting device may rescan before the availability write lands.

A "Hide songs while disconnected" switch on the phone's Link page and
the desktop's Phones section turns it off; it is on by default.
2026-11-08 02:42:18 +07:00
zarzet 8fe787a002 feat(convert): let Smart Dither use TPDF HP
Smart Dither only adds dither when lowering bit depth, but it always used
plain TPDF. A new Use TPDF HP switch makes it use high-pass TPDF instead,
in the convert sheet (shown while Smart is selected) and for automatic
FLAC conversion of downloads (under Smart Dither, saved as
autoConvertSmartDitherHighPass). The native Android finalizer, the
Dart FFmpeg path and Mornye Link conversions all honor it; Link sends it
as ditherHighPass, which older desktops ignore. The switch is off by
default, so existing conversions do not change.

The explicit Triangular HP option is now labelled TPDF HP, next to TPDF.
2026-11-07 19:48:04 +07:00
zarzet b889dabbb4 feat(link): add computer library visibility toggle 2026-11-06 21:27:48 +07:00
zarzet 8918ff8935 fix(link): keep the song on screen while it moves to the computer
The computer pushes its state 250 ms after a change, while the phone
switched to the computer's player as soon as the handoff returned. In
that gap the phone showed the computer's last known state, so the
previous song's cover and colors flashed although the song never
changed.

Remember the song moved and hold the computer's state until it names
that song, for at most five seconds. A paused phone that shows the
computer's own song is unaffected.
2026-11-05 23:24:49 +07:00
zarzet 20e5b550d9 chore: neutralize UI terminology and clarify code comments 2026-11-04 22:53:56 +07:00
zarzet dd6b2599c1 fix(windows): poll connectivity without registering network listeners 2026-11-04 04:03:46 +07:00
zarzet 7ada9533d5 fix(lint): align Library test overrides and notifier APIs 2026-11-04 02:27:18 +07:00
zarzet ac42470758 fix(link): refresh phone catalogs after desktop file deletion 2026-11-04 01:28:52 +07:00
zarzet 363f506304 fix(link): delete shared phone songs from desktop 2026-11-04 01:03:32 +07:00
zarzet cb88dc0a3c fix(library): preserve artwork and silence automatic scan notices 2026-11-03 14:15:00 +07:00
zarzet 6e07941b35 feat(library): save network songs offline with independent copies 2026-11-03 03:18:14 +07:00
zarzet 3e6fbee433 fix(link): preserve artwork during remote track changes 2026-11-01 23:01:53 +07:00
zarzet 269a4d97fa perf(link): reuse desktop player window state
Map runtime queue entries lazily with a 400-entry LRU and retain the last catalog-resolved player window. Overlay enriched current metadata through a lazy singleton view keyed by base, item and index. Compare retained scalar and display-tag inputs directly so mutable extras invalidate without allocating metadata snapshots on cache hits.

A 20000-song fixture maps only its 200 requested entries, including a rich current item. Sixty unchanged ticks add no mappings, metadata copies or catalog lookups; full traversal retains at most 400 base memo entries. All 109 scoped tests pass, including the existing playback-details regressions, and eager-overlay and missing-invalidation negative controls fail as expected.
2026-11-01 21:40:09 +07:00
zarzet dac6591c15 fix(link): relay playback artwork and metadata across devices 2026-11-01 21:29:52 +07:00
zarzet 524ab69511 perf(link): filter remote rows and release published phone catalogs
Exclude network sources in SQLite before catalog paging and isolate mapping. After a successful publish retain only the catalog version and file lookup map, rebuilding song pages only when the desktop needs them.

The reconnect fixture releases 1,001 song records, serves files without a rebuild, and reproduces identical wire pages after remote state loss. Targeted SQL and Link regressions pass; update the old query-plan assertion for the existing Windows alias visibility check.
2026-11-01 21:25:38 +07:00
zarzet 4c78dade09 perf(network): reuse cover clients and coalesce permission checks
Share one HTTP client across a catalog cover run, while cancelling only the expired request or body and keeping peer requests usable. Coalesce concurrent Android permission checks without retaining grants across later requests.

A 12-cover catalog uses one client instead of 12 and at most four connections. A burst of 100 permission checks uses one channel call instead of 100. All 82 focused network tests pass, including deadlines before and after response headers and permission revocation.
2026-11-01 20:55:22 +07:00
zarzet 3efb32ba2e perf(link): send negotiated download queue deltas
Keep full queue snapshots for older phones and after reconnect, while
subscribed phones receive changed rows, removals and bounded ordering.
Serialize and coalesce sends so each delta follows a delivered baseline,
and reject stale HTTP refreshes after pushes or connection changes.

A 200-row progress fixture sends 145 bytes instead of 19,418, with the
legacy peer still receiving all 200 rows. Targeted compatibility, race,
ordering, failure and lifecycle regressions pass.
2026-11-01 20:52:24 +07:00
zarzet d789c08630 perf(link): suppress idle state heartbeats and redundant pings
Send periodic player states only while connected and playing, keeping debounced changes and reconnect state delivery. Skip remote playback publication for download-only updates. Keep transport ping/pong liveness while paused and avoid a server ping after recent client traffic.

Negative controls observed four eliminated paused phone states per minute, three redundant download-driven playback events reduced to zero, and server ping suppression with client pings. All 104 scoped Dart tests and 114 Rust tests pass, with strict analysis, clippy and format checks.
2026-11-01 20:11:40 +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 d602f0f180 fix(link): refresh phone library on reconnect
Rescan persisted phone catalogs when a phone reconnects so stale Library entries can recover even when catalog hashes match.

Validate online and offline deletions, persisted catalog replacement, and reconnect recovery. All 121 related tests pass; scoped analysis and formatting checks are clean.
2026-11-01 16:53:32 +07:00
zarzet b5f2565816 fix(link): read embedded phone lyrics without cached audio 2026-11-01 16:24:56 +07:00
zarzet 0640617e47 fix(link): exchange missing listening statistics covers 2026-11-01 00:41:37 +07:00
zarzet 74d5272842 fix(link): sync AI lyrics translations across devices 2026-11-01 00:36:04 +07:00