Commit Graph
664 Commits
Author SHA1 Message Date
zarzet e624e062a7 refactor: drop parameters every caller leaves at the default
_stopConnectivityMonitoring always cleared the Wi-Fi pause, LibraryDatabase.getAll
was never paged and MethodChannelBackend never received other event channels.
2026-10-23 23:08:48 +07:00
zarzet 671b712485 chore(providers): remove unused provider members
MusicPlayerController.play/pause/stop, PreviewPlayerState.progress, the
manual extension cleanup, setUseExtensionProviders and the repo store's
unused category list, clearError and write-only fields have no caller.
2026-10-23 23:08:48 +07:00
zarzet 0be275a3b1 chore: remove unread extension manifest model fields
The health check, hook, setting and track matching fields were parsed from
backend JSON but never read, and quality options only need a settings count.
2026-10-23 23:00:46 +07:00
zarzet 19d25eae57 chore(download): remove test-only DownloadQueueNotifier.updateProgress
Production progress flows through the native progress poller, so only tests
called it; the clearAll test now uses updateItemStatus for late progress.
2026-10-23 22:44:37 +07:00
zarzet 5700c9a87c refactor(download): pass AppSettings to the output folder builders
Every caller expanded the same settings fields into named arguments, so the
builders now read them from AppSettings; requeue resets, SAF publish result
parsing and the MIME switch are shared or shortened too. The settings matrix
test pins identical folder output.
2026-10-23 22:44:37 +07:00
zarzet a41e5d9b16 test(download): pin relative output folders for a settings matrix
Records every folder the builder produces across organization, structure,
flag and playlist combinations before the builders change shape.
2026-10-23 22:44:37 +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 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 b882b01f32 chore(history): remove the unused streaming history restore
Backup restore goes through restoreFromBackupOperation with the native or
upsertBatch codec, so the streamed replaceAll path was only reached by tests.
The iOS restore test now drives the production operation with a seeded fake.
2026-10-23 22:43:22 +07:00
zarzet 26695a8d34 refactor(player): share the current queue index rule
The Mornye player layout and its queue repeated the same "reported index
while it still names the current item, else first match" rule; one
provider now derives it, with a test for stale, shuffled and empty queues.
2026-10-23 22:28:23 +07:00
zarzet aad3496fb2 chore: remove unused history lookups and restore wrapper
findExisting, updateAudioMetadata, getAllFilePaths, the notifier's sync
getBySpotifyId/getByIsrc and restoreFromBackup had no callers; production
restore goes through restoreFromBackupOperation.
2026-10-23 19:16:30 +07:00
zarzet 24054bfd58 perf(history): extend lookup indexes when a download is prepended
Each completion rebuilt all three history lookup maps over every loaded
item, so a long batch did quadratic key normalization. A prepended item only
wins its own keys, so copying the maps and writing those keys gives the same
lookups.
2026-10-23 19:16:30 +07:00
zarzet 26e027fbe1 refactor(settings): route setters through one commit helper
Every setter repeated the state assignment followed by a save. A private
synchronous _commit keeps that order and the returned save future, while
guards, normalization and backend syncs stay where they were.
2026-10-23 19:15:36 +07:00
zarzet a0eac85eab refactor(settings): reuse the shared library quality label normalizer
SettingsNotifier kept a private copy of normalizeLibraryQualityLabelMode
with the same switch arms and fallback, so call the util instead.
2026-10-23 19:15:36 +07:00
zarzet 30a5c82f0f feat(library): list the files a scan could not read
A finished scan only reported how many files it skipped. The Rust
scanner and the Android SAF scan now record the first 100 failed files
with the reader's reason and include them in the finished progress
report.

Library settings show the count under each folder, and its actions
open a sheet listing each file, its folder and the reason. The list is
kept per folder across restarts, cleared by a clean scan and removed
with the folder. Network folders keep only the count.

Validation: provider, model and Rust scan tests, and the full Flutter
suite on a clean tree with only this series applied.
2026-10-23 03:50:05 +07:00
zarzet 44a7fad0b9 feat(downloads): add custom folder path templates 2026-10-23 03:17:10 +07:00
zarzet 0fe8b7df39 chore(l10n): drop the rebrand tour strings and its seen flag
The tour screen is gone, so its strings leave every translation.
upgradeIntroContinue stays because extension action forms use it.
Settings migration 15 removes the upgrade_intro_mornye_seen preference
that the tour left on existing installs.
2026-10-23 00:06:22 +07:00
zarzet 7a0d6afbe0 fix(notifications): handle Linux launch callbacks and contain queue alerts 2026-10-22 23:44:43 +07:00
zarzet 11a9b9a4ec chore: remove redundant comments across the codebase 2026-10-22 01:41:09 +07:00
zarzet 6e137fcc24 feat(material): mark the current track in catalog and search lists
Online album, playlist and Library folder rows (phone tiles and the
desktop table) and Library search song rows now show the current track
the way Library and album rows do: a primaryContainer fill, the
equalizer glyph, and on phones the pill shape. Search and folder play
buttons pause and resume the current track instead of restarting it.
Mornye rows are unchanged.

Rows now match the player by the file they play rather than by media id
alone. Every queued item carries its file as its source, while its id
depends on where the queue started (a download row, a Library row, or
the path itself from a playlist). Library rows, downloaded and local
album rows and both tables compare files when both sides know one, so
a local track queued from a playlist marks the local album table too,
and an id another source happens to share never marks a row.

Catalog rows have no file of their own. The current item's download or
Library record is resolved once per track change, and a catalog row
matches on that record's id, on equal ISRCs, or on its catalog id
together with the same title and artist. A catalog id alone, or a title
and artist alone, never marks a row, and rows stay unmarked while the
record resolves.

The desktop songs table takes each row's playback provider instead of
a media id.
2026-10-21 23:45:09 +07:00
zarzet fcdd898fdc fix(backup): preserve extension repository for automatic restore 2026-10-21 16:09:17 +07:00
zarzet fc7e73fed5 fix(player): preserve audio information from track metadata 2026-10-21 14:11:05 +07:00
zarzet c9732fe440 fix(downloads): keep finalized FLAC paths and container names consistent 2026-10-21 01:48:14 +07:00
zarzet 9f5b2ff30c Merge branch 'desktop/d15-enable-backend' 2026-10-20 17:44:49 +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 6b4f81d87b feat(desktop): turn on the core backend and extension system
supportsCoreBackend and supportsExtensionSystem now include desktop, so
extensions, native data jobs, cache maintenance, backups and library
ingestion use the Rust library there. Download and library scan progress
use the native event streams, cover downloads let the backend create the
file in its own folder, and extension initialization drains a callback
URL queued at launch, as on Android.
2026-10-20 16:52:45 +07:00
zarzet 490e529203 feat(desktop): wire deep links, single instance, keep-awake, Discord, watcher and crash logs
- mornye:// URLs arrive through app_links and go to the backend callback
  inbox (queueExtensionCallbackUrl); extension auth opens the system
  browser on desktop.
- Single instance: a named mutex plus app_links WM_COPYDATA forwarding on
  Windows (with the installer's AppUserModelID), a unique GApplication
  forwarding its command line on Linux; macOS handles reopen itself.
- The download queue holds a sleep inhibitor from start until it stops.
- Discord Rich Presence runs on desktop through a channel adapter over the
  backend IPC methods, without an account link.
- Library folder changes trigger a debounced incremental source scan.
- Desktop rotating log files, a session marker that turns an unclean exit
  into the existing crash report, and runtime errors recorded for it.
2026-10-20 16:14:40 +07:00
zarzet e9849b6b4f feat(playback): add a PlaybackDeck seam and enable the macOS equalizer
Introduce PlaybackDeck, injected through PlaybackDependencies.createDeck,
so the runtime and AutoMix no longer depend on audioplayers types. The
audioplayers implementation becomes AudioplayersPlaybackDeck and keeps
Android's native USB path; it now owns the release mode and audio context
through configureOutput.

macOS gets the equalizer: the audioplayers_darwin fork shares its tap
source between iOS and macOS. On Windows and Linux, until their own deck
lands, enabling the equalizer reports it as unavailable.

Desktop uses an in-app output gain (playbackOutputVolume) that every deck
multiplies into its own gain, and the volume slider writes it instead of
the system volume. Music haptics, pause on mute and play on headphones
are hidden and disabled on desktop.
2026-10-20 14:37:03 +07:00
zarzet bd4f827a88 Merge branch 'desktop/d4-storage' 2026-10-20 13:44:59 +07:00
zarzet 840b28d549 feat(desktop): enable notifications and gate mobile-only plugins
Initialize flutter_local_notifications for macOS, Linux and Windows
(AUMID com.zarz.mornye with a stable GUID) and post result notifications
on desktop; live progress stays in the window. Open files through
url_launcher, skip audio_session, and use the login keychain on macOS.
2026-10-20 13:44:30 +07:00
zarzet 6aeed936b4 feat(desktop): use plain folders and SQLite FFI on desktop
Windows and Linux open databases through sqflite_common_ffi with the
bundled SQLite; macOS keeps sqflite_darwin. Desktop databases live in
the application support directory. Downloads default to <Music>/Mornye,
and setup and the Files settings pick plain folders without permission,
SAF or bookmark steps.
2026-10-20 13:44:25 +07:00
zarzet 840e16e1f4 feat(desktop): add desktop platform check, scroll and theme defaults
Add isDesktopPlatform. Desktop windows skip the tablet UI scaler,
Windows and Linux use Material's clamping scroll with scrollbars while
macOS keeps the bounce, and a first launch without a stored style
starts in Mornye on macOS and Material on Windows and Linux. Mobile
behavior is unchanged.
2026-10-20 13:36:18 +07:00
zarzet 51d3459426 chore(branding): drop remaining SpotiFLAC references
Remove the original SpotiFLAC creator and PC source links from About,
point docs links and podspec homepages at mornye.com, drop stale
SpotiFLAC build artifact cleanup, and rename incidental test data.
Legacy compatibility (backup magic, lyrics provider id, extension
suffix, signed session protocol) is kept so old data still loads.
2026-10-20 12:27:29 +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
zarzet 00b7cf9979 fix(crash): reduce repeated notices and retain diagnostics 2026-10-20 03:01:06 +07:00
zarzet 9ded49f31e fix(player): refresh late duration updates without reopening 2026-10-20 01:59:59 +07:00
zarzet 9eea6a1a03 feat(playback): add normalization pre-amp and track or album gain
Volume normalization levels tracks to the -18 LUFS ReplayGain
reference with no way to aim lower or keep album dynamics. Add a
pre-amp from -15 to +6 dB, shown with its resulting target loudness
(-7 dB targets -25 LUFS), and a Track or Album gain mode that falls
back to the other tag when one is missing.

The cache now keeps both gains per file, so changing either setting
re-levels the playing track without reading tags again. Volume stays
capped at the source level, so a positive pre-amp cannot clip, and
downloaded tags keep the standard -18 LUFS reference for other
players.
2026-10-20 00:39:08 +07:00
zarzet 19056edf14 perf(library): cache unchanged SMB and WebDAV scan metadata 2026-10-20 00:28:55 +07:00
zarzet 9acaa760a3 fix(haptics): render music pulses on basic motors and add tuning sliders
Phones without tuned haptic primitives often use an eccentric mass motor
that needs tens of milliseconds to spin up. The previous 12 ms on/off
pulses and low-amplitude one-shots were mostly not felt, so only the
loudest hits produced any vibration. On/off motors now play hits from
intensity 0.35 for 25 to 50 ms, and amplitude-controlled motors play
20 to 40 ms pulses with a minimum amplitude.

Analysis keeps every candidate hit with its threshold score, so a new
Sensitivity setting reselects pulses without decoding the song again.
The midpoint reproduces the previous selection exactly. A Strength
setting scales pulse intensity from 0.4x to 1.6x.
2026-10-20 00:24:12 +07:00
zarzet a3b14a285b fix(downloads): embed enriched artwork across audio formats 2026-10-19 23:47:40 +07:00
zarzet 27a45c0499 fix(backup): reconcile restored iOS paths before publishing history
Force container path migration after both native and streamed history restores so Library recognizes a downloaded file and its scanned entry as the same file.

Repair previous restores once on startup, page path reads, and update stored paths and match keys in one transaction. Surface forced migration failures instead of publishing a successful restore.

Add SQLite regression coverage for duplicate visibility, physical-file lookup, repeated restores, paged rollback, and unchanged external paths. Validation: 72 targeted tests passed, analyzer clean, and formatting and diff checks passed.
2026-10-19 22:57:36 +07:00
zarzet e58217c8cd fix(library): release network scan memory and cancel active metadata reads
Release completed directory listings and iterators during SMB and WebDAV scans. Scope file deduplication to direct directory children so large libraries do not retain every scanned path.

Cancel scan-owned metadata reads immediately on cancellation or provider disposal, and clear scanner ownership on completion.

Add forced-GC regression coverage for directory listings and paged library rows, cancellation coverage, and repeated native SMB scan worker cleanup checks.
2026-10-19 20:40:01 +07:00
zarzet cb51d08939 feat(crash): show persistent crash reports on Home 2026-10-19 16:17:58 +07:00
zarzet 378c8f3749 fix(library): recover interrupted scans and stale notifications
Serialize scan notifications and surface failures even when database error persistence fails. Recover interrupted scans independently of auto-scan, retain their checkpoints, and collect matching Android process-exit details on restart.
2026-10-19 15:43:00 +07:00
zarzet 18fd556869 chore(lyrics): rename first-party provider to Zarz-LRC
Update settings, About, provider descriptions, and lyric source credits. Preserve the stored provider ID and recognize both current and legacy credits as direct sources.
2026-10-19 11:18:45 +07:00
zarzet ff7afa5b3c refactor(library): split local_library_provider.dart into source, scan and cover parts
The provider file mixed source management, the scan pipeline and the
cover lookup providers. Move the private notifier methods into
extensions in two parts (_LocalLibrarySources, _LocalLibraryScan) and the
cover request types and providers into a third part. The moves are
verbatim except for one reference to the static heartbeat constant,
which an extension must qualify with the class name. Public notifier
methods, which test subclasses override, stay on the class in the
library file.
2026-10-19 01:18:02 +07:00
zarzet de142abae6 refactor(library): share the scan completion tail as _finishScan
The full-scan and incremental branches of _runScan ended with the same
sequence: source state update, last-scanned prefs, summary refresh, the
mounted check, the final state, log and completion notification. Move
that sequence into _finishScan. The only differences, the cover cache
prune after a full scan and the summary text, become parameters; the
summary stays a closure so it still reads the state after the final
update. Each call is the last statement of its branch, so the early
return on unmount keeps the same effect.
2026-10-19 01:18:02 +07:00
zarzet b0600c1ff7 refactor(library): remove the unreachable snapshot sub-branch of the incremental scan
The Dart incremental ingestion branch runs only when
PlatformBridge.supportsCoreBackend (Platform.isAndroid || Platform.isIOS)
is false. Its useSnapshotBridge flag required Platform.isAndroid, so it
could never be true there, and the native handlers for
scanSafTreeIncrementalFromSnapshot and
scanLibraryFolderIncrementalFromSnapshot are already gone.

Remove the flag, both PlatformBridge methods, and
LibraryDatabase.writeFileModTimesSnapshot(Map), whose only other user was
test/library_scan_snapshot_test.dart (deleted with it). The live native
snapshot path (writeNativeFileModTimesSnapshot) and the host-test branch
with _backfillLegacyFileModTimes are unchanged.
2026-10-19 01:18:02 +07:00
zarzet 857c2954d8 refactor(collections): move playlist cover file I/O into PlaylistCoverStore
LibraryCollectionsNotifier carried about 130 lines of File and Directory
work for playlist covers. PlaylistCoverStore now owns the playlist_covers
directory, the <playlistId>.jpg normalization with its temp file, the
backup restore copy or base64 write, and the delete helpers. The
directory is still resolved through getApplicationSupportDirectory on
each call, at the same points as before.

The notifier keeps setPlaylistCover, removePlaylistCover,
exportPlaylistCoverFiles and restoreFromBackup with unchanged signatures,
mutation ordering and error handling: a failed restore of one cover still
drops that cover path, removePlaylistCover still propagates delete
errors, and replacing a cover still deletes the old file quietly.
2026-10-19 01:01:25 +07:00
zarzet 8af7efb6ce refactor(providers): move UI-declared providers to lib/providers
The listening summary and system volume providers lived in UI files.
They move verbatim to lib/providers with the same names; the old files
re-export them so tests and other importers are unchanged.
2026-10-19 00:56:52 +07:00