Commit Graph
65 Commits
Author SHA1 Message Date
zarzet 7aa2f37496 chore: remove comments that restate the code
One-line doc comments and inline comments that only repeat the name, the
type or the next statement of what they describe, in the Dart, Kotlin and
desktop runner sources. Comments that state a reason, a constraint, a
unit, a value set or a platform quirk stay. No code changes.
2026-11-17 02:06:37 +07:00
zarzet 064f02b5de perf(player): list an Android song's folder once for its sidecars and cover
Starting a song from a granted Android folder looked for the .mlrc file,
the .lrc file and cover.mp4 with three separate native calls, each
resolving the song's parent again and listing the whole folder to find one
name. Big flat folders paid that three times on every song start.

One native call now resolves the parent once, reads the song's name once
and finds every wanted name in a single listing, returning uri, size and
modification time for each file that exists. A small Dart lookup shares
that answer between the lyrics sidecar reads and the motion cover lookup
for a few seconds, so one song start lists the folder once while a later
start of the same song asks again. Writing a sidecar or a tag change of
the song forgets the shared answer. Sidecar contents are read by document
uri only for files that exist, with the same 8 MB cap. Name rules are
unchanged and now live in a pure helper with JVM tests.
2026-11-16 16:17:06 +07:00
zarzetandre-code e82f7f2f1b fix(lyrics): read edited SAF songs again instead of their old copy (#859)
Lyrics synced by hand in the editor for a document (SAF) song came back
unsynced after leaving the song and returning to it. The song played from
a cached copy made before the edit: a tag change only retired network
copies, so the next play reused the old copy and the player read the old
lyrics from it.

A tag change now retires the song's playback copies, as ReplayGain edits
already did, and the queue item no longer names the old copy, so probes
read the document until playback makes a fresh copy. The player's lyrics
reload from the changed document itself, and only when its tags were read
before. A copy an edit retires stays on disk until no deck holds it, so a
song that plays, or is about to open its copy, keeps its file.

Ported from PR #859 onto the current metadata listener; the editor save
pinning in that PR is already here as PlayerLyricsEdit.

Co-authored-by: re-code <re-code-dev@proton.me>
2026-11-15 23:33:45 +07:00
zarzet 962e582acc chore(flutter): move to Flutter 3.50.0 and the material_ui packages
Flutter 3.50 deprecates its built-in Material and Cupertino libraries in
favour of the material_ui and cupertino_ui packages. The imports move
with the official fix (dart fix, migrate_design_widgets); the app's old
two-library theme bridge collapses into one Theme type.

- MaterialExpressiveScope keeps the complete host theme nearest its
  child. The reduced copy made for the expressive widgets now shares the
  app's Theme type and would hide component themes and extensions.
- LegacyThemeBrightness hands the brightness to the glass package, which
  still reads Flutter's built-in theme.
- appLocalizationsDelegates lists the material_ui localization delegates;
  the generated list still names the built-in ones.
- Tests: findByTooltip and pageBack replace the flutter_test helpers that
  only know the built-in widgets, and several tests that had gone stale
  against earlier app changes are repaired.
2026-11-15 23:33:29 +07:00
zarzet 5bec86ca2b feat(metadata): review re-enrich changes one by one and undo them
A single song's re-enrich now shows each change with the current and
new value and its own switch before anything is written. A smaller
cover, and an empty value over one the song has, start switched off.
Apply writes only the switched-on fields; Cancel writes nothing.

Every re-enrich write first saves what it replaces. The result offers
Undo (Undo all for a batch), and the song's menu offers Undo re-enrich
while the state is kept. Undo writes back through the metadata editor,
so it reaches the same storage as re-enrich.

The song page now writes through the Library's re-enrich runner
instead of its own FFmpeg copy, which also stops it dropping tags it
does not manage.
2026-11-15 18:04:21 +07:00
zarzet 5da029f162 feat(lyrics): read .lrc files next to songs and bilingual LRC translations
Now Playing, the desktop player and lock screen lyrics read only the
lyrics inside the song file, so a WAV or any song with its lyrics in a
.lrc file beside it showed no lyrics, while the song details card did.
The player now reads that .lrc file when the song holds no lyrics of its
own, for local files, Android folders and iOS alike. The song's own
lyrics still come first. Edits and saved translations of .lrc lyrics go
back into the .lrc file instead of the song.

The song details card also reads the .lrc file of an Android document,
which the lyrics reader cannot reach.

Bilingual LRC files time each translation like the line it translates.
When most moments of a song are such a pair, both lyrics parsers now
show the second line as the first line's translation. A few shared
timestamps, such as simultaneous singers, stay separate lines.
2026-11-11 00:56:24 +07:00
zarzet c03a5f4621 feat(reenrich): pick the result a song is updated from
Re-enriching one song, from its page or from a one-song Library
selection, now lists the online results instead of applying a guess:
results that fit come first, with their source and how well they fit,
and the rest stay folded under Other results.

A batch review lists the songs no result fitted well enough to apply on
its own with a Choose a result row, and every matched song can change
its result. Edit Metadata > Auto-fill searches the same way, so both
rank and list results alike.
2026-11-08 19:23:52 +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 6e570165a9 fix(autoplay): rotate recent suggestions across queue changes 2026-11-07 18:36:02 +07:00
zarzet 305037a907 feat(lyrics): save translations to .mlrc files
Saving a lyrics translation now covers every kind of lyrics:

- Plain lyrics can be translated on request. Each line's pronunciation
  and translation show under it. Automatic translation stays synced-only.
- AI pronunciation is saved too, with its word timing, as x-romaji and
  x-romaji-words tags next to the translation.
- A new .mlrc file next to the song keeps its lyrics with their
  translation and pronunciation and leaves the audio file as it is. It is
  UTF-8 LRC that starts with [x-mlrc:1]. Supplement tags are keyed by
  line time, or by line index for lyrics without timing. TTML is written
  as enhanced LRC with voices and backing vocals. The player reads it next
  to local and Android document songs and lays it over the song's lyrics
  by line text.
- AI Translation settings gain a Files section: Save To picks the song
  file or a .mlrc file, and Save Automatically saves each shown
  translation without a snackbar. TTML and plain lyrics always go to
  .mlrc. Saving into the song file also refreshes an existing .mlrc.
- Android reads and writes the sidecar through new SAF calls, and the
  .lrc sidecar write shares the same code.
2026-11-07 15:19:06 +07:00
zarzet 1df540f90b fix(lyrics): preserve editor track when playback changes
Snapshot the original draft and writable source when opening the lyrics editor, and keep saves bound to that track after playback advances or stops. Disable live timing controls for other tracks and cover file, SAF, and asynchronous save races with regression tests.
2026-11-06 21:33:19 +07:00
zarzet 1225eb5b8d feat(artist): add album grids and a saved page for offline
Shelves that overflow their pane offer Show all, a grid that keeps
loading pages.

An artist page now saves a copy once loaded. When the provider cannot be
reached it shows that copy with a note, and albums open from the Library
where they exist. An artist never opened online has no saved page. Library
artist pages link to the full page.
2026-11-06 20:53:20 +07:00
zarzet c074582205 fix(metadata): re-enrich writable network library files 2026-11-05 15:52:26 +07:00
zarzet 708efa4ecf feat(mornye): Music's glass inspector, player actions and Home text
Float Lyrics and Up Next as a slim glass panel over the pane while the
window is not full screen, with no title bar and the capsule beside it.
Give the desktop player More and Favorite discs, Music's menu, and shuffle
and repeat at the transport's ends. Set Home's desktop text at Music's
smaller sizes.
2026-11-04 21:58:50 +07:00
zarzet b68b5f42a3 feat(library): play, queue and delete files from a collection selection
Playlist, Loved and Wishlist selections can play the selected songs, play
them next or add them to the queue, and delete their local audio files
after a confirmation that says every playlist using them is affected.
Removing entries from the collection keeps the files and stays a plain
action. Phones end the bar with the full-width delete button and desktop
keeps it beside Remove, as in the Library selection bar; the desktop row
menu offers the same actions.
2026-11-04 16:22:00 +07:00
zarzet 1bb9c5094d feat(lyrics): edit and sync lyrics from the player
Adds a lyrics editor for the playing track (issue #801). It opens from the
lyrics options button (now also shown over plain lyrics) and from a Write
lyrics action when a track has none: a full-height sheet on phones, a
720dp editor dialog on desktop.

Each line has its time, which plays from there, and an editable text.
Set time gives the selected line the current position and moves to the
next one, so a song can be synced while it plays; -0.1 and +0.1 nudge the
selected line. Lines can be inserted, deleted or cleared of their time
from a row menu, also on right click.

The editor edits the raw LRC, so tags, singer prefixes, backing vocals,
translations and enhanced word timing survive a save; word timing moves
with its line and is dropped from a line whose text changes. An [offset:]
tag is applied to the times. Saving embeds the lyrics in the original
file through the existing player lyrics persistence and shows them at
once. Streams, TTML and network songs that are not SMB or WebDAV stay
read-only.
2026-11-04 01:59:24 +07:00
zarzet 6e964bb2d3 feat(player): open audio files and folders directly 2026-11-04 01:35:52 +07:00
zarzet 6e07941b35 feat(library): save network songs offline with independent copies 2026-11-03 03:18:14 +07:00
zarzet 39d3ba6c53 merge: sync reviewed pull requests from origin main 2026-11-03 00:44:44 +07:00
zarzet 1669422cc6 feat(library): add whole-library metadata re-enrichment (#787) 2026-11-02 20:02:31 +07:00
Keven Chantre 6e89e64a17 feat: Add re-enrich all tracks functionality and related UI components 2026-11-02 02:37:44 +00:00
zarzet dac6591c15 fix(link): relay playback artwork and metadata across devices 2026-11-01 21:29:52 +07:00
zarzet 4a53a24366 feat(lyrics): automatically embed online search results 2026-11-01 20:16:59 +07:00
zarzet b2626ac95e perf(library): reuse suggestion matching and playlist seeds
Keep normalized collection match keys and filtered suggestions across page rebuilds. Snapshot candidate identities and history membership so edits and in-place list changes invalidate derived results, and sort playlist seeds once per collection snapshot.

Host widget checks reduce match-field reads from 3000 to zero over five rebuilds of a 200-track collection. All 170 scoped tests pass, with clean lib/test analysis and formatting.
2026-11-01 19:34:32 +07:00
zarzet 8e24b08fec feat(download): add FLAC quality caps and Opus 160 kbps
Add FLAC auto-conversion with maximum bit depth and sample rate in foreground and Android background downloads. Preserve lower source rates, artwork, metadata and output quality.

Keep 48 kHz available for mixed-source batch conversion and add 160 kbps to manual, batch and automatic conversion.

Validation: 122 Flutter tests and 26 Android JVM tests passed. Analysis of lib and test passed.
2026-11-01 00:06:41 +07:00
zarzet b336075b77 perf(library): match collection history keys once per page data
The visible history membership of an open album, playlist or artist
page rebuilt on every history state change (each completion, each
coalesced index bump, each count refresh) and re-derived, for every
track, the Spotify ID candidates (a set, a lowercase pass and a URI
parse), the trimmed ISRC, the title and artist key and the lookupKey
string. Desktop pages rebuilt the lookupKey list again per build.

The request snapshot now caches its lookupKeys, the visible-membership
notifier derives each track's in-memory index keys once per request,
and it returns its previous set when neither the lookup items (which
own the indexes) nor the persisted keys changed. DownloadHistoryState
exposes its title and artist key and an index read by that key. Album,
playlist and artist pages read the cached keys.

Same sets as before: tests compare against a copy of the old per-track
matching over tricky IDs, ISRCs, case and 300 random rounds. Host, a
1,000-track page with 100 history items: a change of the lookup items
went from about 990 us to 185 us, a count or revision change from
about 990 us to 22 us, and 31 history changes read no track field.
2026-10-31 01:30:13 +07:00
zarzet 361d97fa03 fix(covers): show a collection song's network cover only where it loads
A Loved or playlist song of a network connection now stores its
network:// cover reference, and three paths handled it poorly:

- A song that resolves to a local file (a later download, or a Library
  match) played with the reference as its artwork, which blocked the
  embedded cover recovery and fetched over the connection while the
  local file played. The reference now applies only to a network
  source; a local file shows its own cover as before.
- Go to album passed the reference into album pages and recents, which
  load covers over http only, so the page showed a failed cover instead
  of the provider's. It now passes http covers only; a store path never
  loaded there either.
- The writer compared the shown cover against the default store, while
  the player chose it with its runtime's store. The player provider and
  the media controls now pass the runtime's store. It is the same
  object in production.
2026-10-30 18:55:58 +07:00
zarzet e30e213ed3 fix(link): refresh playback and details after desktop file changes 2026-10-30 13:12:05 +07:00
zarzet a325cb6ae0 fix(player): read deferred ReplayGain tags in audio info 2026-10-29 23:28:21 +07:00
zarzet 0aa867cb5a feat(link): manage desktop music files from mobile
Add paired-phone actions for deletion, metadata editing and re-enrichment, conversion, ReplayGain, and cover or lyrics export. Run serial desktop jobs with progress, cancellation between songs, retry deduplication, and status recovery after reconnecting.

Review re-enrichment before applying it, resolve catalog IDs against current records, and refresh metadata and artwork on both devices. Support batches of up to 100 songs from one computer.

Validation: 163 Flutter tests passed, scoped analysis and pinned formatting passed, and git diff --check is clean.
2026-10-29 02:21:39 +07:00
zarzet 4b18a270dd fix(metadata): save animated artwork during re-enrichment 2026-10-29 01:48:14 +07:00
zarzet fad59b8519 perf(conversion): speed up FLAC encoding and reuse SAF sources 2026-10-27 02:20:20 +07:00
zarzet 01a37e383a fix(ios): respect verification browser preference
Try the external browser first when selected, retain in-app authentication and browser fallbacks, and stop fallback launches after cancellation.

Add regression coverage for iOS preferences, launch failures and desktop routing. Fixes #729.
2026-10-25 22:41:51 +07:00
zarzet 403f9903aa fix(library): keep scanned songs unplayable while Local Library is off
Loved songs, playlists, Android Auto collections, track rows, the
collection metadata screen and the Home On repeat shelf still matched
tracks to scanned files after Local Library was switched off. They now
use downloads only until it is on again.
2026-10-25 13:02:11 +07:00
zarzet 44cbb57b30 refactor: import moved files directly and remove the re-export shims
Eight one-line re-export files remained from an earlier move into controllers, models and providers. Every import now points at the real file, so the shims are deleted.
2026-10-24 03:27:23 +07:00
zarzet 18ee77004d refactor: make ClickableArtistName single-line with ellipsis
All twelve callers passed maxLines: 1 and TextOverflow.ellipsis, so the
widget now applies them itself and the two parameters go.
2026-10-24 00:12:34 +07:00
zarzet 78f60e7576 refactor: push plain material pages through pushPage
Forty-two call sites spelled out Navigator.push with a MaterialPageRoute
around a builder; one helper next to pushViaPreferredNavigator keeps the
same route type and builder closure with fewer lines.
2026-10-24 00:12:34 +07:00
zarzet 22d73faa11 refactor(pages): drop the title flip rebuild opt-out from the header mixin
Every collapsing header screen now hands showTitleNotifier to its header,
so the setState path and its per-screen opt-outs are dead.
2026-10-23 23:45:04 +07:00
zarzet 7f323e88b1 refactor(library): move confirm dialogs to showAppConfirmDialog
Thirteen hand-written cancel/confirm dialogs in the batch actions, track
metadata, setup, statistics, extension and queue selection code now use the
shared helper with the same flags and styles. Every caller only acted on a
true result, so the helper's false-on-dismiss keeps their behavior.
2026-10-23 23:14:57 +07:00
zarzet 4707feeaa3 refactor(library): share the collection selection bar toggle
Album, playlist and artist pages each rebuilt the same select all toggle
around SelectionBottomBar; SelectionModeMixin.buildSelectionBar now does it
once. The Library selection bar's mobile delete reuses
DestructiveSelectionButton with its own label.
2026-10-23 22:49:09 +07:00
zarzet 04277f40bd perf(pages): rebuild only the toolbar title when it flips
The collapsing title flip used setState, rebuilding the whole album,
playlist, artist or track metadata page mid-scroll. The mixin now keeps the
flag in a ValueNotifier that these headers listen to; screens that still read
the bool keep the page rebuild.
2026-10-23 22:49:09 +07:00
zarzet a397cf0d74 refactor(ffmpeg): call the FFmpeg modules directly
FFmpegService only forwarded each call to FFmpegProbe, FFmpegMetadata,
FFmpegConversion, FFmpegDecryption or FFmpegReplayGain with identical
defaults, so callers now use those modules and the test-only markers move
to the owning statics.
2026-10-23 22:44:37 +07:00
zarzet dfa5e0d994 perf(library): reuse the prepared page data across rebuilds
Each Library rebuild combined every loaded page, filtered playlist tracks
and regrouped the in-memory History snapshot up to three times, so the
section cache never hit and every row's month was formatted again. The
results are now memoized per input identity, with identical output.
2026-10-23 22:31:44 +07:00
zarzet 11a9b9a4ec chore: remove redundant comments across the codebase 2026-10-22 01:41:09 +07:00
zarzet 44a5cd7153 fix: keep the album page on top when Go to Album names it
Go to Album always pushed a new album page, so choosing it from a track
on the album already shown stacked a second copy of the same page.

Album pages now record which album their route shows. The shared push
helper skips the push when the page on top already shows that album; it
still dismisses a modal such as Now Playing first. An album without a
provider matches the same id from any provider, since a track's source
can name the provider the page resolved on its own.
2026-10-22 00:44:56 +07:00
zarzet 8b062dc353 fix(desktop): keep a right-click selection to its menu
Right-clicking a song outside the selection made it the selection and
opened the selection toolbar under the menu, and choosing Play or Show
details left that toolbar open.

That selection now belongs to the menu: the toolbar stays closed while
the menu is open, closing the menu without a choice ends the selection,
and Play and Show details end it like the queue and playlist actions.
Bulk actions (re-enrich, convert, delete) keep it and bring the toolbar
back. showContextMenu reports whether a row was chosen, and
SelectionModeMixin.showSelectionMenu applies this on the album, folder
and artist pages; the Library and its search results do the same.
2026-10-21 23:22:07 +07:00
zarzet 909a70c173 fix(desktop): present Material song menus and sheets as desktop surfaces
On desktop the Material style still opened phone bottom sheets: the song
page's More button, the search sort options, explore and discography
actions, batch convert, the playlist picker, quick actions, the download
service picker, the metadata editor's option pickers and the cue split
sheet all called showModalBottomSheet directly.

The song page now opens its items as a menu anchored under the More
button on Material desktop, through the same context menu machinery as
the Library's right-click menus, while phones keep their sheet and
Mornye keeps its popover. The remaining call sites go through
showAppModalBottomSheet, which already presents a centered dialog on
desktop. The adapter gains a mornyeGlass switch, mirroring the dialog's,
for content that draws its own glass (batch convert, the playlist
picker, the discography sheet and the floating download picker on
phones), so phone appearance stays as it was.

A test opens the Material song page menu on desktop and on a phone and
checks for the anchored menu or the sheet.
2026-10-21 20:00:09 +07:00
zarzet a428b37879 feat(i18n): mirror layouts for right-to-left languages
Use directional insets, alignments, positions and borders so Arabic and
other RTL locales lay out from the right. Mornye chevrons use the
CupertinoIcons glyphs that match text direction, synced lyric voices
align to start and end, and transport controls, seek bars and progress
stay left to right as media timelines do.
2026-10-21 14:59:26 +07:00
zarzet 87c92c8d78 feat(desktop): add Library context menus, song table and hover play
The Library Songs page shows the desktop table, sorted through the Library sort modes, and song rows and cards select on click, play on double click and open the selection's menu on right-click. Playlists, folders, albums, artists and queued downloads get menus, album tiles show a play button on hover, and the sort and filter choices open as menus on desktop.
2026-10-20 17:38:54 +07:00
zarzet 728c1a1ac8 feat(desktop): add context menus, list selection and a song table
Right-click, Shift+F10 and the Menu key open item menus (MenuAnchor on Material, MornyeContextMenu on Mornye). DesktopListScope adds Cmd/Ctrl+A, Escape, Delete and Enter to selectable lists, and SliverTrackTable shows sortable song columns. The album screen uses the table on desktop.
2026-10-20 17:38:54 +07:00