Commit Graph
1098 Commits
Author SHA1 Message Date
zarzet 43112cb9e5 feat(home): recommend songs outside the Library
Home gains a "Recommended for you" shelf in both styles, after Recently
added: songs the person does not have that resemble the ones they play
most, added last and loved.

The songs come from the machinery behind "Suggested songs": an extension
that suggests related songs, else a metadata provider searched by artist.
Three seeds are taken from a pool of up to 45 Library songs, and each day
starts from other songs of the pool. One request is made per day; the
answer is kept for the day, and a failed request falls back on the last
day's songs. Songs already in the Library are left out when the shelf is
shown, so a recommended song leaves it once downloaded. Seeds from files
carry no ID, since a file's ID may be its path.

As on search results, a tap downloads the song and a long press or a right
click opens its actions; a song with a preview has a preview button on its
cover. The shelf is absent while it has nothing to show.

Appearance > Layout has a switch for the shelf, on by default.
loadCollectionSuggestions takes the number of songs to return.
2026-11-22 00:34:47 +07:00
zarzet f4c9766bf0 feat(home): keep Home personal and open Search on the extension feed
Home showed either the chosen extension's feed or the person's own
sections, never both, so anyone with a feed extension lost the
shortcuts, mixes and Library shelves, and the Material Home also carried
the search field.

Home is now the person's own page in both styles and never asks for a
feed. Search is a destination in both styles (Home, Library, Store,
Search, Settings; Mornye phones keep Settings as a page) and opens on
the feed before anything is typed. Recent searches wait for the field
while a feed fills the page; a tap beside the empty field, Back, or the
Search destination pressed again returns to the feed. Without a feed
Search opens on recent searches, and with neither a provider nor a feed
it shows the provider prompt under the field. The Mornye bar's search
button opens the feed first and focuses the field when pressed on
Search, or at once when there is no feed. The Mornye desktop Search page
keeps its recents row and Browse tiles.

Both styles now share one destination order, so the search tab flag of
the shell navigation service and the style argument of the tab order
helpers go. The Material rail and Cmd/Ctrl+1..5 gain Search.

With an empty Library and nothing played, Home says so in both styles
and offers a "Find music" button that opens Search; the Library's empty
state on Mornye leads there too. The feed setting is renamed from Home
feed to Search feed (English and Indonesian; other languages keep the
old wording until translated). The feed no longer repeats the greeting
or Top Picks, which Home already shows.
2026-11-22 00:34:47 +07:00
zarzet 8398845ce7 build(mobile): compile desktop-only code out of phone builds
isDesktopPlatform is only known at run time, so phone builds carried
the desktop player engine, the desktop diagnostics and the Windows
folder lookup. With --dart-define=MORNYE_MOBILE=true it is a
compile-time false and the compiler drops what only desktop reaches.
Android and iOS release builds pass the define.

Three call sites reached desktop code without asking
isDesktopPlatform; they ask now. Without the define (desktop builds,
tests) nothing changes.
2026-11-22 00:19:10 +07:00
zarzet 2139e777e2 fix(lyrics): load the pinyin data on Android
Chinese lyrics showed no pinyin on Android. With Flutter 3.50 the
Android build passes Flutter assets through the Android asset merger,
which unpacks a file ending in .gz and drops the extension. The APK
held assets/romanization/pinyin.txt, the app asked for pinyin.txt.gz,
and the missing asset left romanization off without an error.

The file is now assets/romanization/pinyin.bin, still gzipped inside,
which the merger leaves alone. On an emulator the same lyric file shows
no pinyin in the build before this change and pinyin after it.
2026-11-22 00:17:34 +07:00
zarzet 8dce3c48fb build(lyrics): pack the pinyin data in a binary format
The pinyin table of offline romanization was gzipped text, 259 KB. The
same readings, phrases and traditional pairs now use a binary layout:
code points delta-coded and grouped by reading, phrases front-coded
with only the syllables that differ from a character's usual reading.
It takes 157 KB.

PinyinData.decode reads both formats and build_pinyin_data.dart gains
--repack to convert an existing file. Every character and phrase reads
as before (44369 characters and 9522 phrases compared).
2026-11-22 00:16:40 +07:00
zarzet 188e031c0c perf(playback): add queued songs in one step
Adding many songs to the queue inserted them one by one and renumbered
the play history after each. They now go in with one insert. The haptics
update returns early while haptics are off, and a media item gets its
playback instance when it is built instead of through a second copy.
2026-11-21 22:05:01 +07:00
zarzet fe8f8b5ec2 perf(link): listen to the collections only while a computer is attached
The sync runner and the watcher of kept collections listened to every
collections change for the app's lifetime. Both now listen only while a
client is set, the watcher also only while something is kept. A new
connection still starts a full pass. The cover of the song a computer
plays is looked up without blocking the UI thread.
2026-11-21 22:03:37 +07:00
zarzet 0ed85f6e60 perf(database): cheaper visible Library view and album statistics
The view of visible Library rows ran its Windows duplicate check and its
split CUE check for every row. One test per query now skips each check
when no such rows exist, and the duplicate check joins in a fixed order.
The view is recreated on open while it still has the old text. Listening
statistics get an index on the album name, and the temporary table of
downloaded Library files is renamed into place instead of being copied.
2026-11-21 22:02:09 +07:00
zarzet f072a3e7be perf(collections): add to a playlist without loading its songs
Adding songs to a playlist first read and decoded every song already in
it. A playlist that is not loaded now only gains the new keys and stays
unloaded: its songs are read when it is opened, and a load already under
way starts over because the keys changed. The loved keys and the keys of
all playlists are updated in place instead of being rebuilt from every
list. Playlist songs get an index on (playlist_id, added_at), the order
they are read in, in place of the index on playlist_id alone.
2026-11-21 22:00:40 +07:00
zarzet 5c6fa36291 perf(startup): overlap launch work and defer the storage check
The desktop log setup and the Android install marker read now run beside
the preferences load. The access check of the saved download folder no
longer holds the first frame: the shell waits for it after that frame,
and asks again only when the check gave no answer (a timeout or a
channel error). The wait for wallpaper colours is skipped where no theme
uses them (Mornye, or dynamic colour off), the cover cache starts beside
the other services, and the settings reach the backend in parallel.

The Link source presence no longer creates the Library provider on the
first frame, and the playback notification reads the collections only
once there is a song. The storage migration prompt asks whether it was
shown before it asks for the device details. The Mornye bottom bar hears
only whether the keyboard is open, not every frame of its animation.
2026-11-21 21:57:41 +07:00
zarzet 5be1786d8a fix(link): keep a typed computer address instead of the one discovery finds
A computer paired by typing its address, for example a VPN address, lost
that address as soon as the phone saw the same computer on the local
network: discovery moved the saved record to the address found there
without checking that it answers. Discovery runs again whenever the app
comes back to the front, the network changes or the connection drops, so
the move happened some time after pairing. When the found address is
blocked by a firewall that lets the VPN through, or the phone later leaves
that network, the computer could not be reached any more, and restarting
either app did not help because the typed address was gone. Only removing
and pairing again brought it back (issue 945).

The record now remembers that its address was typed, and discovery leaves
such a record where it is. Seeing the computer on the network still makes
the phone try the typed address again at once. Pairing again keeps the
typed address; choosing the computer from the nearby list makes it follow
discovery as before. Records saved earlier were never marked and behave as
they did.
2026-11-21 21:34:08 +07:00
zarzet 7ac57ea618 feat(automix): choose how often songs are mixed on their beats
AutoMix mixes two songs on their beats only when it is sure of both beat
grids, and otherwise crossfades. Measured offline over 64 songs of a mixed
library in every order, that was 0.8% of the pairs: 96% failed because one
of the two grids was not certain enough, 3% because the tempos were too far
apart, and none because of a late first beat.

Lowering the confidence a single analysis window needs was not the way: of
the songs whose first window scored 0.25 to 0.35, fewer than half kept the
same tempo six seconds later. Agreement between two windows is the better
evidence, and the analyzer already asked for it, but only from a second
window that was itself certain. A grid recovered that way is now marked
confirmed, and the new Beat matching setting chooses how certain the
confirming window must be and how far the incoming tempo may move:

  Standard     0.55, 8%   0.8% of pairs (unchanged behaviour, the default)
  More often   0.40, 10%  3.7%
  Most often   0.30, 12%  6.2%

The tempo and phase agreement the analyzer requires is unchanged, and so
are the first beat limit and the alignment check when the mix starts.

The setting rests while the transition effect is Crossfade, travels with
Link sound sync (a peer without it ignores the key), and falls back to
Standard for a value it does not know.
2026-11-21 21:20:02 +07:00
zarzet 96d77562ee feat(track): re-download one song and copy its title from track details
Issue 944 asked for a re-download action on a single song and for "Copy track and artist" in track details. Re-download existed only as the bulk "Queue FLAC" action of a selection.

Track details gain Re-download, after Re-enrich. It asks first, finds the song online from the tags the page shows (an exact ISRC wins, otherwise the scored search with its unchanged threshold), and queues the match on the default download service the way a download from search is queued, quality picker included. It tells the listener when no confident match was found, when the song is already in the queue, or when no download provider is set up. It is hidden for songs on storage the page cannot write, for Link songs, and while the song is still in the queue.

The current file is never touched. A re-download is queued to keep both files, whatever the quality variants setting says, since without it a file of the same name in the download folder ended the download as "already exists" with nothing written.

Matching compared titles and artists after removing every non-Latin character, so two songs in another script both compared as empty and matched each other. Letters and digits of any script now count, and two values of only symbols score nothing. This also applies to Queue FLAC.

"Copy track and artist" sits after "Copy file path" and copies "Song - Artist".
2026-11-21 15:13:46 +07:00
zarzet 0422895708 feat(import): read track links from a CSV and match rows more strictly
Issue 944: a CSV with a URL column imported nothing, because the importer only knew title, artist, ISRC and a few fixed id columns.

A column named URL, Link, Track URL or Track Link is now read, in the Rust parser and the Dart one. Each link goes to the extension that handles it, the way a pasted link does, so the song comes back with its own id, source and cover. A link to an album or a playlist adds all its songs, in the file's order. A row whose link no extension handles falls back to its ISRC, then to its title and artist. A bare track id from the fixed legacy id columns is tried as its link form first.

Matched rows now carry the provider's id and source, and its comment, preview and quality fields, so they download like songs added from search. Text matching is stricter: the title must agree, and the artist when the row has one; a partial match counts only as whole words of four letters or more, never for filler like "track" or "song". Rows that used to match loosely keep their own text instead.

For a link to one song or one album, the cover comes from the first metadata provider in the listener's priority order that has the exact ISRC, when that is another provider than the link's. A playlist keeps its own covers, since it would cost one search per song.

An empty or unreadable file now shows a message instead of nothing. The retry loop for links moved out of the track provider into a shared resolver that both use.
2026-11-21 15:08:09 +07:00
zarzet bd1c25abbc feat(library): set one cover for every selected song in Set common values
A request asked for a cover art option in Re-enrich > Set common values that takes an image from the device and applies it to all selected songs.

The sheet gains a Cover Art row: pick an image, see its thumbnail and name, clear it again. A cover alone is enough to continue. In the review it shows as a cover change like any other and can be switched off there.

A song with a picked cover is saved through the metadata editor's save, in one write with the typed values, since the re-enrich write only embeds a cover from a web address. Other tags stay as the song has them. A song that cannot take the cover counts as failed for that song only; undo, progress and the library refresh work as for the text values.

The image picker moved out of the single-song editor into a shared function; the editor behaves as before.
2026-11-21 15:08:08 +07:00
zarzet d3ab2724d8 feat(extensions): name the extension that asks for verification
A verification page gives no hint of which extension asked for it, and neither did the app around it.

While a download waits, its queue row now reads "Waiting for <extension> verification...", the notification that asks the listener back says which extension the verification is for, and the help dialog (browser did not open, or still waiting) has a "Requested by <extension>" line. The message for a missing verification page shows the extension's name where it showed its id.

The name is the one the extension shows in the app, with the id as the fallback for an extension the app does not know. The queue item keeps the asking extension's id in its waiting marker, after a colon, so the row can name it; a marker without one reads as before.
2026-11-21 14:46:57 +07:00
zarzet 8f313b7bce feat(lyrics): let the lock screen line take the artist's place
A listener suggested showing the track name with the line being sung under it, where the artist's name is, instead of the line replacing the title.

Lyrics settings gain a Keep the song title switch under Lyrics on lock screen, off by default and available while that one is on. With it the line goes out as the session's artist and the title stays; in a break, while paused or unlocked the artist is back, as the title was before. Switching it while a line shows moves the line at once.

The line still shows in the same parts as in the title, so nothing about its timing changes.
2026-11-21 12:36:12 +07:00
zarzet 631abf83e1 fix(cast): load the next song after the TV finished one
Issue 942: a song cast to a Chromecast ended and the next one never
started.

Every song change stops the deck before it loads the next source. The
Cast deck sent Stop to the receiver for that, but a receiver that played
the song to its end has no media session left: Google's sender refuses
the request when it holds no media status, and the app's own sender
answers "Nothing is loaded on the TV". The error left the song change
before the load, so the queue stood still. A manual skip worked, because
the session was still alive then.

The deck now remembers that the receiver finished the loaded song and
sends it no Stop or Pause after that. A Stop the receiver still refuses
is logged instead of thrown: the load that follows replaces whatever it
plays. Play at the end of the queue went through the same Stop and works
again too.
2026-11-21 11:31:47 +07:00
zarzet 7b33af22f1 fix(player): keep the last session when the system stops playback
A stop from the system arrives without arguments: the media card swiped
away in the notification shade, a dismissed playback notification, a stop
key from a headset or car, or a stop from the desktop media controls. It
ran the same path as a queue that has nothing left to play, which deletes
the saved session, so the next start showed no last played song and Home
offered nothing to continue.

Such a stop now archives the queue and position like closing the player
inside the app does, and Home offers Resume. The two callers that stop
because the queue has no playable song left ask for the old behaviour
explicitly.
2026-11-20 22:05:13 +07:00
zarzet 4544948762 fix(library): show a song's own artwork when its web cover cannot load
A tester reported that offline most thumbnails in playlists, albums, folders, genres and artists disappear, while song rows keep theirs.

Song rows show the artwork inside the song file first. The other places draw the cover's web address whenever a download has one, and a web cover is only kept in a cache that is capped at 1000 images and 150 MB and shared with every Home and Search image, so most of a large library is not in it. The album page asks for a larger version at another address, which is why a cover seen there did not help its tile.

Those places now fall back to the artwork inside a song file on the device when the cover fails to load: Mornye album, artist and genre tiles, Material artist and genre rows, folders and their song rows, playlist rows and tiles, Library search results and the Up Next rows. Online nothing changes, since the file is read only after a failure. A playlist row or tile looks its file up in the database at that moment. Songs on network storage are left out.

Cover requests also give up connecting after ten seconds, so a network without internet reaches the fallback instead of waiting for the system's timeout.
2026-11-20 21:35:36 +07:00
zarzet 6aa51c0902 fix(home): keep a genre mix over an artist or decade mix of the same songs
Giving every kind of mix a turn first also made the first decade and
artist mixes before the fourth and fifth genres, so a genre whose songs
one of them already held was dropped as a repeat.

Mixes are made in the old order again (favorites, genres, then the
kinds that cut across them), which decides who keeps shared songs. The
turn taking now only decides which of the made mixes fill the shelf
when there are more than it shows.
2026-11-20 02:17:59 +07:00
zarzet 1a40015982 feat(home): more varied mixes, with Deep Cuts, a year mix and artists of the day
The mixes on Home came out the same shape every day: the five genres
played most, three discoveries and two decades, with an artist mix only
where genre tags were missing.

Two kinds are new. Deep Cuts gathers the songs not played lately by the
ten artists played most. The year mix holds the songs released this
year, or last year when this one has too few, and is left out when most
of the Library is from that year.

The shelf is also built for variety. Every kind gets a turn before any
kind gets a second mix, so a large Library no longer fills up on genres.
A tagged Library gets up to two artist mixes, from the four artists
played most with five songs or more, starting from a different one each
day. One genre past the five played most joins, a different one each
day. Discoveries take turns with the other mixes instead of standing in
one block, and Home shows up to twelve mixes instead of ten.

The cache key moves to v3 so the new kinds show on the day of the
update.
2026-11-20 02:12:43 +07:00
zarzet 7447af0ee0 fix(usb): let go of an idle Direct USB DAC, so other apps keep their sound
Direct USB takes the DAC away from Android's own audio driver for as long
as it holds it. It held it through every pause, after the last song of a
queue, and for a song prepared but never started (a session restored at
launch), until the player was stopped. Swiping the app away does not stop
the player, so a paused Mornye left every other app without sound through
that DAC until it was unplugged. The level hand-back of 4ed523ac0 never ran
either, since it runs when the session stops.

After five seconds without playing, the deck now ends the native session:
the DAC goes back at the level it connected with and is released. The deck
keeps the song's position and reports that its source needs a reload, the
path a lost USB route already takes, so play opens the DAC again and
continues from there; a seek while released moves that position only.
The Android mixer and AAudio outputs are not affected.

This widens when the level goes back up: after an idle pause, not only at
the end of a session. If the DAC cannot be opened again on play, the song
plays through Android's mixer at that level, as loud as any other app.

Not run on a DAC.
2026-11-19 18:40:22 +07:00
zarzet 119131baae fix(logging): log why the USB output paused on its own
A pause the native output raises itself (a failed transfer, lost feedback,
a decoder error, the DAC unplugged) reached the app as a state change only,
so a tester's exported log showed nothing. The Direct USB event now carries
its message, and both that event and a status read back as lost are logged
as "Native output paused: <reason>: <message>".
2026-11-19 18:23:17 +07:00
zarzet 4ed523ac03 fix(usb): hand the DAC back at the level it connected with when playback ends
Direct USB lowers a DAC to at most -40 dB when it opens it and never wrote a
level back, so once the app let go of the DAC, Android's mixer played every
other app through a DAC left that low: quiet until it was unplugged.

When the playback session ends (the player is stopped, or the engine goes
away), the app now pauses, writes back the level the DAC had when the app
first opened it after it was attached, and lets go of it. It only undoes its
own lowering: a DAC that reads higher already is left alone.

Not between two songs. There a song can follow through Android's mixer
(a stream, a format the output refuses), and with the level back up it would
play 40 dB louder than the one before. That case stays quiet as before, and
a session that ends without the DAC open forgets the level instead of
writing a stale one later. A killed app cannot write anything.

Not run on a DAC.
2026-11-19 18:08:02 +07:00
zarzet d8e6292811 fix(usb): fetch a song whose saved copy is gone, instead of streaming it
A song saved from a server plays from its local copy and falls back to a
stream of the server file when that copy is missing. With the USB output on
that stream went through Android's mixer, like the network songs fixed in
a4605cbdf. The whole-copy fetch now also covers this fallback: it downloads
the origin, and the source resolver plays that copy before it asks the
server for a stream.
2026-11-19 17:48:48 +07:00
zarzet a4605cbdfc fix(usb): fetch a network song whole before it plays, so it keeps the USB output
The USB output opens whole local files only. A network song (NAS, server or
a computer through Link) without a copy in the prefetch cache streamed, and
a stream plays through Android's mixer: no exclusive access, and at whatever
level the DAC was left on. The cache only holds the next two songs and starts
after three seconds of play, so a tapped or skipped-to song, and any large
song still downloading when its turn came, lost the output. A tester's log
shows exactly that: "USB output not used: this song streams" after each
skip, on songs of every sample rate.

With USB bit-perfect on and its output connected, such a song now downloads
ahead of its neighbours and starts from the copy. It streams as before when
the copy cannot be kept (too large, no file extension), the download fails,
60 seconds pass, or no output is connected, which the new outputPresent
query answers so playing without a DAC does not wait. A newer play request
ends the wait at once. Waits of half a second or more, and every fallback,
are logged.
2026-11-19 17:33:57 +07:00
zarzet bdd8be35b2 feat(profile): show the listener's record, taste and collection
The profile row of Settings opened a form for the name and the photo and
nothing else. It now opens a profile: the avatar and name with one line
for the taste and the month listening began, the song in the player, and
what the listening record and the Library hold.

- All time: listening time, songs and artists played, listening days, the
  current and the longest streak.
- Last 30 days: the time, the change against the 30 days before, a bar
  per day and the artists first heard.
- Music taste: the genres the listening time goes to. Genres come from
  the Library; a played song is matched by title and artist, because a
  record carried over from another device knows songs by other paths.
  Shares are of the time whose genre is known.
- Listening habits: time by weekday, the favorite and the biggest day, an
  ordinary listening day and the song replayed most in one day.
- Top artists, albums and tracks, and the collection: songs, albums,
  genres, loved songs, playlists and favorite artists.

With Record listening off only the collection shows. The form moved to
its own page behind Edit profile and returns to the profile on Save.
2026-11-19 15:28:12 +07:00
zarzet d07568fef1 feat(home): show Library albums in On repeat's place without a listening record
A tester turned "Record listening" off and still saw On repeat on Home.
The shelf reads the last four weeks of the statistics and never looked at
the switch, so songs recorded earlier stayed until they aged out. Tapping
one then started a queue of the shelf, which read as an old queue coming
back.

With the switch off, the played shelves (On repeat, and Recently Played
in the Mornye style) are now empty and do not read the statistics. The
record itself is kept, so they return when the switch goes back on.

So Home keeps its number of sections, On repeat's place is taken by
"From your Library": ten albums of the Library, picked anew each day.
Each album gets its place in the day's order from a stable hash of the
day and its key, so a download landing mid-day swaps one cover at most
instead of reshuffling the shelf. A Library of more than 300 albums is
read through a window that moves with the day. Choosing a cover opens
the album. The shelf is read only while the switch is off.
2026-11-19 15:06:48 +07:00
zarzet f05bec0440 fix(desktop): do not crash while the window moves between screens
FlutterView.display throws a null check error when the engine has replaced
its display list and the view does not yet name one of the new displays,
which happens while a window is dragged on Windows. Every read of the
display now goes through displayOf, which gives null in that case.

Fixes #930
2026-11-18 21:48:21 +07:00
zarzet 96a285a959 fix(downloads): keep failed downloads in the queue after a restart
A failed download was dropped when the queue was saved, so after a restart
nothing showed which songs never arrived. It is now saved and restored as
failed, with its error, and is not retried on its own; retrying or
dismissing it works as before.

Fixes #931
2026-11-18 21:48:21 +07:00
zarzet da608a6638 fix(usb): never set a rate the DAC's clock does not list, and add a rate limit
A song whose rate the DAC refuses is already converted, but the DAC was
still asked for that rate first, for every song, and a DAC that takes the
request and then plays silence was never converted at all.

- Read the UAC2 clock's RANGE before setting a rate and refuse one it
  does not list, without touching the clock.
- Remember per connected DAC the rate a song rate played at, so the
  refused rate is not requested again on each song.
- Add "Highest sample rate" to the Direct USB settings (Automatic by
  default): rates above it are never requested and such songs are
  converted down.
2026-11-18 21:48:21 +07:00
zarzet 208bd75696 feat(usb): resample a song whose rate the DAC refuses
A DAC that tops out at 48 kHz refused 96 kHz songs, so they fell back to
Android's mixer and played through a DAC still set to the low level the
direct driver leaves it at, which sounded like silence.

Direct USB now tries the other standard rates when the DAC refuses the
song's own: lower rates first, the song's own family ahead of the rest,
then higher ones. The song is converted with a Kaiser windowed sinc
polyphase filter (130 dB stopband, passband to 0.907 of the lower
Nyquist), with triangular dither for a 16-bit output. The status line
names both rates and Audio info no longer calls such a song bit-perfect.

DSD is never converted, and a DAC is asked at most four times.
2026-11-18 01:00:13 +07:00
zarzet c6d65ccdae fix(logging): log every reason a song skips the native USB output
Refusals without a detail (no DAC, permission declined, cancelled) and
platform errors left no line, so a log could not tell why a song played
through Android's mixer.
2026-11-18 00:40:24 +07:00
zarzet cff77a0dbf fix(desktop): keep the output open across a gapless song change
The load hook of the queued song set gapless-audio back to no before mpv
had decided whether that song keeps the open device, so the device was
closed and reopened at every song change. The libmpv build used on
Windows closes it without playing what is still queued, which drops the
end of the previous song.

The option now goes back to no once the queued song has started.
2026-11-18 00:35:44 +07:00
zarzet f51427bc48 fix(motion): keep the badge bump's height at every Animation speed
The push of the Mornye badge was measured once, on a spring that already
followed the Animation speed, and then scaled again: after a restart with
the speed changed the bump was about twice or half its height. The push is
now measured on the spring in use, once for each style and speed.

With USB bit-perfect output on, every song now logs whether the USB output
was requested for it and what kind of source it has, so a log shows which
songs go through Android's mixer and why.
2026-11-17 21:33:30 +07:00
zarzet 87ab865bc1 fix(logging): say where an uncaught error happened and when USB output is skipped
An uncaught error's log line now ends with the first frames of its stack:
a tester's export held two null-check errors with nothing to trace them
by. A song that streams while USB bit-perfect output is on logs that the
USB output is not used for it, which a report of songs losing exclusive
output could not show.
2026-11-17 21:21:15 +07:00
zarzet d2584e5be8 fix(desktop): give the audio device back when the app quits
Nothing stopped libmpv when the window closed, so the process ended with
the stream open. With exclusive output on Windows the device was reported
to stay silent after that until it was plugged in again. A quit request,
and the quit for an update, now stop every libmpv deck and wait until its
output is closed.

The audio output's own lines (device period, buffer, format, underruns)
now reach the log, for reports of crackling in exclusive mode.
2026-11-17 19:29:47 +07:00
zarzet 7b266ba2e4 feat(downloads): save the album cover as folder.jpg in the album folder
Portable players often do not read the cover inside a song and look for a
folder.jpg beside it. A new Files setting, Save Album Covers (off by
default), saves the cover a download carries into the album's own folder,
with a size choice from the sizes of Embedded Cover Size. The rule of the
animated cover applies: only folders that hold one album get the file, and
one already there stays. A PNG cover is saved as folder.png; other image
formats are not saved.

The folder writing of the animated cover moved to SongFolderFile, which
both covers use for local folders, Android documents and network storage.

While the setting is on, Remove Empty Folders counts folder.jpg and
folder.png as leftovers of a deleted album. While it is off they keep
their folder, as before.

Issue #913
2026-11-17 11:55:17 +07:00
zarzet 4856f1ee0a fix(covers): read a song's cover again after a failed read when it is played
A failed read of an embedded cover was remembered for the whole run for
plain files, so a song read once before the desktop backend had started
showed no cover until the app was restarted. Playing or opening the
song now asks again after 30 seconds; lists still skip a failed file, so
files without a cover are not read at every scroll.
2026-11-17 11:40:08 +07:00
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 846792c436 fix(link): keep the phone's volume its own while playing together
While the computer owns the queue in Play together, the phone's screens
and media session show the computer, so the volume keys and the player's
volume slider set the computer's volume although the phone sounds too.
Both now set the phone's own volume for as long as the two play together
and return to the computer afterwards.
2026-11-17 09:40:22 +07:00
zarzet cf68a7d943 fix(home): do not offer a scanned song to continue while Local Library is off
Continue listening showed the saved session whatever it held, so a song on
a NAS stayed on Home, and played from the NAS, after Local Library was
switched off. The saved session is now left out while it is on a song of
the scanned Library and that Library is off, as Recently Played and the
mixes already do. Downloads and songs the Library does not know stay.
2026-11-17 08:50:36 +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