diff --git a/docs/release-1.2.6/TAG_DETAILS.md b/docs/release-1.2.6/TAG_DETAILS.md new file mode 100644 index 000000000..ca081a7f8 --- /dev/null +++ b/docs/release-1.2.6/TAG_DETAILS.md @@ -0,0 +1,134 @@ +# 1.2.6 — Accolade Watch (accessibility patch) + +A quick follow-up on the heels of 1.2.5. Two things drove this release: + +- A long-overdue **accessibility pass**: four new WCAG-compliant themes (including a true high-contrast mode for severely vision-impaired users) and mouse-drag scrolling on every horizontal album row. +- A **regression rescue**: Infinite Play (the ∞ toggle in the queue) had silently lost its backend wiring during the V2 migration — the toggle persisted in localStorage but the queue never refilled and the mode was never sent to the backend. Reimplemented from scratch in V2 with no legacy wrappers. + +Everything from 1.2.5 below is included as well; if you're upgrading from 1.2.4 or earlier, this is what you're getting. + +--- + +## What's new in 1.2.6 + +### Accessibility (discussion #313) + + - **Four new WCAG-compliant themes** in Settings > Appearance > Theme: + - **WCAG Light** — AAA contrast (7:1+) on every text level, blue accent + - **WCAG Dark** — AAA contrast on dark backgrounds + - **High Contrast** — pure white on pure black with yellow accent (21:1 ratio). Built explicitly for severely vision-impaired users + - **Colorblind** — deuteranopia-safe palette (Wong colors), no red/green adjacency + - **Mouse-drag scrolling on horizontal album rows** — click and drag sideways on Home, For You, Award and Label views, just like on iPad or in a browser. Arrow buttons still work as before + - **Qobuz Connect badge always visible** (#318) — even with an empty queue (e.g. on app start) you can connect to a remote renderer instead of having to start playing something first; the badge keeps its size across responsive breakpoints + +### Regression fixes + + - **Infinite Play (∞) restored** (#319) — the toggle now persists across restarts and refills the queue with related tracks (Qobuz `/radio/artist`, seeded from your last played tracks) when the queue ends, instead of stopping. V2 reimplementation + - **Gentoo `qbz-bin` ebuild** — now correctly inherits `xdg-utils`, so the hicolor icon cache and the desktop database are refreshed on install/uninstall. This was the cause of stale icons after upgrading to 1.2.5 + +### Branding polish + + - **App icon resized to fill the canvas** (matches Steam/Chrome/Papirus footprint, ~97%) with a subtle blue rim and inner highlight so the matte-vinyl disc doesn't disappear on dark backgrounds; new 512x512 PNG export added + - **Tray icons regenerated** to match the new vinyl Q (the v1.2.5 refresh missed the monochromatic tray glyphs and the Snap launcher) + - **Login screen** — drop-shadow under the logo removed (the new icon's edge rim and inner light make it redundant) + +--- + +## What 1.2.5 brought (still applies) + +After a rough week of real-world work, this release brought a dedicated Award view, labels you can follow, and one of the most anticipated sections from the mobile apps landing on the desktop at last: **Release Watch**. + +On the functionality side, you can drag and drop any track — or a multi-selection — from any listing onto the sidebar playlists. The rest of the changes are mostly architectural and not user-facing, but they show up as overall stability. + +Regarding Qobuz Connect: I know there's still a lot of room for improvement. Most of it is WIP and will start landing in the coming releases. + +I want to mention again that the project has been receiving donations. I had linked the accounts to an email I don't check very often and only noticed last week — I'm overwhelmed (in the good way) and genuinely flattered. I haven't fully decided how to use the funds yet, but part will definitely go toward infrastructure. When I started the project, the free tiers seemed more than enough; now we have hundreds of installations on Snapcraft, thousands on Flathub, and a steady stream of direct downloads from GitHub releases. Since qbz has zero telemetry, I can only keep a partial count — it's not a number I ever imagined reaching. These donations will let me make sure the Cloudflare workers that power the MusicBrainz and Last.fm integrations stay up even if we start to brush against the free-tier limits. I couldn't be more grateful to every sponsor, donor, and everyone who supports the project through code, feedback, or simply by using the app. + +Saludos a todos y muchas gracias. + +### Accolades (Awards + Press) + + - **Dedicated Award page** — new `AwardView` with header matching the Label/Album conventions, gold press ribbon, and an "Other awards" carousel; wired to V2 commands for `/award/page` and `/award/getAlbums` + - **AwardAlbumsView** — See-all grid for every award, follow-award as a first-class entity + - **Award resolution by name** — when `/album/get` omits the award id, the backend now resolves it via `/award/explore`, normalises ids end-to-end as strings, and tolerates inconsistent Qobuz shapes on `AwardPageData` / `AwardMagazine` + - **Editorial seed** — `/award/explore` seeds across all locales with diacritic-insensitive lookup; hard-coded seed removed + - **Album-view right sidebar** — shows the full awards stack plus the album's label + - **Album ribbons extended to press accolades** — last award wins on the card; the dedicated sidebar still shows the full stack + - **Home cleanup** — editorial ribbons added for Qobuzissime and Album of the Week on the home rails + +### Release Watch + + - **Dedicated tabbed view** — mirrors the Qobuz mobile layout with its own entry in Discover; moved below Your Mixes in the home grid + - **Backend** — `/favorite/getNewReleases?type=artists` as REST (not signed RPC), projected onto `SearchResultsPage`, artist field backfilled from `artists[0]` + - **Persistence** — Release Watch now survives home-cache invalidations so it renders immediately on revisit + +### Labels + + - **Follow / unfollow labels** — mirrors Follow Artist; heart overlay on `LabelView`'s more-labels cards + - **Favorites → Labels tab** — new tab in the Favorites view + +### Visual identity + + - **New matte-vinyl logo** applied to every icon asset: Tauri standard sizes, Windows Store squares, Android icons and mipmaps, `static/`, README, tray + - **Monochrome symbolic variants** — `tray-light.png` (black glyph) and `tray-dark.png` (white glyph) shipped alongside `tray.png`; the Linux tray picks the matching variant at runtime by probing GNOME `color-scheme`, GTK `prefer-dark-theme`, and KDE `kdeglobals` + - **Login screen refresh** — logo resized to 175px, plus QBZ and "Qobuz™ Player" branding under the mark; `app.tagline` rewritten in en/es + - **About dialog** — fixed a duplicated "License" label (the second row was meant to show the platform); codename updated to "Accolade Watch" + - **DAC Setup Wizard icon contrast** — button icon drops `invert(1)` so it reads on light accent themes (Catppuccin Lavender, Dracula…); the tooltip copy of the same icon now has `invert(1)` so it reads on the dark surface bg + +### Desktop integration (Linux) + + - **Window controls auto-detect** — new `desktop_theme` Rust module reads `kwinrc`, `kdeglobals`, and `klassyrc`; a runtime-derived "Klassy (auto-detect)" or "Plasma (auto-detect)" preset mirrors the system decoration colors and button shape when Plasma is detected, and stays hidden otherwise + - **Klassy button shapes** — `mapKlassyShapeToQbz()` maps Klassy's `IntegratedRoundedRectangle`, `FullHeightRectangle`, `FullHeightRoundedRectangle`, `Tab`, `Circle`, `Square` onto QBZ's `ButtonShape` set; adds a new `full-height-rounded` variant to cover Klassy's most common preset + - **Opt-in rounded window corners** — "Match system window chrome" toggle persists to `window_settings.db` and gates the Tauri window transparency decision at startup; on next launch the main window is rebuilt transparent and the detected corner radius (10 Klassy, 6 Breeze, 12 Adwaita, 8 fallback) is applied via `clip-path` + `border-radius` with GPU compositing for clean anti-aliasing on WebKitGTK + - **ksni tray on Linux** — replaces the libayatana-appindicator path so left-click actually toggles the window (issue #310) + - **Window size clamp** — persisted sizes that exceed the largest available monitor now clamp to fit instead of opening off-screen + +### Streaming, audio, and player + + - **Request signing expanded** — all remaining Qobuz API endpoints and every search endpoint now sign their requests; stronger compliance and fewer 403 edge cases + - **BitPerfectMode surfaced in QualityBadge** (#288) — mode now flows through `PlaybackEvent` and the badge updates on playback start + - **DAC rate unsupported fallback** (#288) — track quality is downgraded and the backend falls back to `plughw` instead of CPAL when the DAC can't handle a requested rate; clearer error when CPAL cannot open an enumerated device + - **Output device missing notification** (#307) — user gets a toast when the selected output device disappears + - **Audio output badges refresh** on playback start + - **ALSA Direct `hw` immersive volume lock** — volume slider is disabled in the immersive player when ALSA Direct hw is active (bit-perfect lock) + - **ALSA default plugin** — `alsa_plugin` defaults to `Hw` when switching to the ALSA backend + - **Gapless loop-one fix** — logic moved from backend to frontend; loop-one now works with gapless playback + - **Gapless local-library fallback** — tries local library if not in any cache; fails silently when track isn't found + - **ALSA engine shutdown** — engine stops before dropping the ALSA stream on format changes + - **Real offline mode** (#279) — snapshot streaming, network blocked, diagnostic logs + - **Player fixes** — `durationSecs` passed on session-restore first play so the seekbar advances (previously stuck); qconnect always persists local session to preserve track-level restore (#304) + +### Updater (opt-in, non-store builds) + + - **tauri-plugin-updater integrated** — backend + frontend; `UpdateProgressModal` added with i18n; wired into app bootstrap and Settings + - **Gated behind Cargo feature `updater`** — sandboxed builds (Flathub, Snap) pass `--no-default-features` so the updater stays disabled for store-managed installs + - **Signed manifest** — minisign public key baked in; CI signs artifacts and consolidates the update manifest; updater manifest path no longer triggers an infinite `tauri dev` rebuild loop + +### UI fixes and polish + + - **Smart positioning for sidebar menus** — the per-playlist right-click menu now flips above the cursor when it would fall below the window; the Sort submenu inside the general playlists menu uses `use:portal` to escape clipping by `.dropdown-menu` + - **Genre filter popup** — collision check reads the CSS `max-height` (530/630 width, 500/700 height) instead of the measured rect so the popup flips above the trigger or clamps to the viewport when content grows asynchronously + - **Right-section collapse** (#303) — hamburger at narrow widths instead of overflow + - **QualityBadge / QconnectBadge compact variants** — keeps them at full bar height without overflow + - **Silk animations removed** from ForYouTab mix cards and Your Mixes covers — performance cost outweighed the visual benefit and they caused minor rendering glitches + - **Multi-select drag** enabled in all views; track drag & drop extended to artist and search views and onto sidebar playlists; compact drag ghost with artist + album + - **Lyrics active line** uses theme accent color + - **For-You load order** — waits for `topArtists`/`recentAlbums` before loading dependent rails + - **Banner layout** uses a CSS variable; i18n key fixed; responsive height + - **Favorites Select All** — new checkbox in multi-select mode across track views + +### Internal architecture + + - **`commands_v2` split into a module directory** — the former single-file module is now nineteen focused files, easier to navigate and review + - **Custom device name** persists across restarts for QConnect + - **Prefetch perf** — cache depth increased to 5 tracks with 2 concurrent CMAF segment downloads in parallel + - **Dependency bumps** — tauri-plugin-dialog 2.7.0, tauri-plugin-deep-link, rodio 0.22.2, vite 8.0.8, svelte 5.55.2, sveltejs/kit 2.57.1, rand, jsdom 29.0.2, notify-rust 4.14.0 + +### Packaging + + - **Snap** — MPRIS slot restored after snapcraft approval; exclusive-audio note added to the description + - **CI ARM64** — native ARM runner replaces QEMU for the aarch64 build; targets glibc 2.35; dropped OpenSSL in favour of rustls across all crates + +--- + +Full changelog: https://github.com/vicrodh/qbz/compare/v1.2.5...v1.2.6 diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..264c8d4ba --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1775888245, + "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "13043924aaa7375ce482ebe2494338e058282925", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 32473d1f7..184c817d7 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ # VERSION BUMP: update version, rev, and hashes # when tagging a new release. # ────────────────────────────────────────────── - qbzVersion = "1.2.5"; + qbzVersion = "1.2.6"; qbzRev = "v${qbzVersion}"; srcHash = ""; # nix build will report the correct hash on first run npmHash = ""; # nix build will report the correct hash on first run diff --git a/package-lock.json b/package-lock.json index 48dc2ae7d..10a7985ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "qbz-nix", - "version": "1.2.5", + "version": "1.2.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "qbz-nix", - "version": "1.2.5", + "version": "1.2.6", "license": "MIT", "dependencies": { "@icons-pack/svelte-simple-icons": "^7.2.0", diff --git a/package.json b/package.json index b8bda3de8..59d805613 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qbz-nix", - "version": "1.2.5", + "version": "1.2.6", "description": "Native high-fidelity client for Qobuz™ subscribers on Linux with Hi-Fi audio support (uses the Qobuz API; not certified by Qobuz)", "type": "module", "scripts": { diff --git a/packaging/flatpak/com.blitzfc.qbz.metainfo.xml b/packaging/flatpak/com.blitzfc.qbz.metainfo.xml index 59df405e8..37c1fbe7f 100644 --- a/packaging/flatpak/com.blitzfc.qbz.metainfo.xml +++ b/packaging/flatpak/com.blitzfc.qbz.metainfo.xml @@ -69,6 +69,19 @@ + + +

Accessibility, polish, and a couple of regression fixes.

+
    +
  • Four new WCAG-compliant themes: WCAG Light, WCAG Dark, High Contrast (pure white on pure black with yellow accent — 21:1 contrast for severely vision-impaired users), and Colorblind (deuteranopia-safe palette)
  • +
  • Horizontal album rows on Home, For You, Award and Label views now support mouse drag scrolling — click and drag sideways like on iPad or in a browser
  • +
  • Qobuz Connect badge in the player bar is now always visible, even when the queue is empty — connect to a remote renderer without having to start playing something first (#318)
  • +
  • Restore Infinite Play: the "∞" toggle in the queue panel now correctly persists across restarts and refills the queue with related tracks (Qobuz /radio/artist) when the queue ends, instead of stopping (#319)
  • +
  • App icon: bigger inside the canvas (matches Steam/Chrome/Papirus footprint), with a subtle blue rim and inner highlight so the matte-vinyl disc doesn't disappear on dark backgrounds; new 512x512 PNG export added
  • +
  • Gentoo: qbz-bin ebuild now correctly inherits xdg-utils so the hicolor icon cache and the desktop database are refreshed on install/uninstall (was the cause of stale icons after upgrade)
  • +
+
+

"Accolade Watch" — a polish release focused on desktop integration, visual identity and small quality-of-life fixes.

diff --git a/packaging/gentoo/qbz-bin.ebuild.template b/packaging/gentoo/qbz-bin.ebuild.template index d829c7b49..26203c2b1 100644 --- a/packaging/gentoo/qbz-bin.ebuild.template +++ b/packaging/gentoo/qbz-bin.ebuild.template @@ -3,6 +3,8 @@ EAPI=8 +inherit xdg-utils + DESCRIPTION="Native hi-fi Qobuz desktop player for Linux (prebuilt binary)" HOMEPAGE="https://qbz.lol https://github.com/vicrodh/qbz" diff --git a/packaging/snap/snap/gui/qbz.png b/packaging/snap/snap/gui/qbz.png index 93394b920..8f41b7829 100644 Binary files a/packaging/snap/snap/gui/qbz.png and b/packaging/snap/snap/gui/qbz.png differ diff --git a/snapcraft.yaml b/snapcraft.yaml index 939bf7f55..8eaf7035a 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -3,7 +3,7 @@ name: qbz-player title: "QBZ — Native Qobuz Client for Linux" -version: '1.2.5' +version: '1.2.6' summary: Native Qobuz player for Linux with bit-perfect audio and DAC control description: | QBZ is a native Linux desktop client for Qobuz™, designed for high-fidelity playback. diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index acb2be486..35c9f9ab7 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4910,7 +4910,7 @@ dependencies = [ [[package]] name = "qbz-nix" -version = "1.2.5" +version = "1.2.6" dependencies = [ "aes-gcm", "anyhow", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 05fd49637..93093ae2e 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qbz-nix" -version = "1.2.5" +version = "1.2.6" description = "Native high-fidelity client for Qobuz™ subscribers on Linux with Hi-Fi audio support (uses the Qobuz API; not certified by Qobuz)" authors = ["blitzkriegfc"] edition = "2021" diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index 714c5ddeb..729a0174a 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index c52fd4b42..8f41b7829 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/256x256.png b/src-tauri/icons/256x256.png index c52fd4b42..8f41b7829 100644 Binary files a/src-tauri/icons/256x256.png and b/src-tauri/icons/256x256.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index 453ee6f0f..1328d7483 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/48x48.png b/src-tauri/icons/48x48.png index e420e2093..9456ca07f 100644 Binary files a/src-tauri/icons/48x48.png and b/src-tauri/icons/48x48.png differ diff --git a/src-tauri/icons/512x512.png b/src-tauri/icons/512x512.png new file mode 100644 index 000000000..d23fb8f21 Binary files /dev/null and b/src-tauri/icons/512x512.png differ diff --git a/src-tauri/icons/64x64.png b/src-tauri/icons/64x64.png index a002d4260..88018a290 100644 Binary files a/src-tauri/icons/64x64.png and b/src-tauri/icons/64x64.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png index 1e869de88..de0a3d5d2 100644 Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png index a6dd3c983..d83bb52d3 100644 Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png index b2f21c30e..b2f3163ec 100644 Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png index 1023f9712..4f1821183 100644 Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png index eb37fb80a..174a9652a 100644 Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png index e7c39d16f..65d2a36bd 100644 Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png index aed136ef5..36ff24fd7 100644 Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png index c0b2d3687..366680c12 100644 Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png index e9f45e0a7..2b51dbdc6 100644 Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png index 8e19df4b7..65cf84581 100644 Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index f2a4c5647..bf1bfea10 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index 047724d6c..e839a3566 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/icons/icon.svg b/src-tauri/icons/icon.svg index 4387d81c0..baed9c904 100644 --- a/src-tauri/icons/icon.svg +++ b/src-tauri/icons/icon.svg @@ -1,306 +1,2 @@ - - + + \ No newline at end of file diff --git a/src-tauri/icons/tray-dark.png b/src-tauri/icons/tray-dark.png index d16e9ef6c..5863b1f9f 100644 Binary files a/src-tauri/icons/tray-dark.png and b/src-tauri/icons/tray-dark.png differ diff --git a/src-tauri/icons/tray-light.png b/src-tauri/icons/tray-light.png index b4014add3..3177d5048 100644 Binary files a/src-tauri/icons/tray-light.png and b/src-tauri/icons/tray-light.png differ diff --git a/src-tauri/icons/tray.png b/src-tauri/icons/tray.png index d16e9ef6c..3177d5048 100644 Binary files a/src-tauri/icons/tray.png and b/src-tauri/icons/tray.png differ diff --git a/src-tauri/src/commands_v2/link_resolver.rs b/src-tauri/src/commands_v2/link_resolver.rs index 473307b46..0689524b1 100644 --- a/src-tauri/src/commands_v2/link_resolver.rs +++ b/src-tauri/src/commands_v2/link_resolver.rs @@ -1636,6 +1636,131 @@ pub async fn v2_create_qobuz_track_radio( Ok(context_id) } +/// Create an infinite radio session based on recent tracks. +/// +/// V2 reimplementation of the legacy `create_infinite_radio` command. +/// Uses the most recent track's artist as the radio seed (via Qobuz `/radio/artist` +/// through `RadioPoolBuilder`) and returns 50 generated tracks WITHOUT touching +/// the queue or playback context. The frontend appends them to the existing +/// queue so the user's current listening session is preserved. +/// +/// Called when the queue is about to end and `AutoplayMode::InfiniteRadio` is on. +#[tauri::command] +pub async fn v2_create_infinite_radio( + recent_track_ids: Vec, + state: State<'_, AppState>, + blacklist_state: State<'_, BlacklistState>, + runtime: State<'_, RuntimeManagerState>, +) -> Result, String> { + runtime + .manager() + .check_requirements(CommandRequirement::RequiresCoreBridgeAuth) + .await + .map_err(|e| e.to_string())?; + + if recent_track_ids.is_empty() { + return Err("No recent tracks provided for infinite radio".to_string()); + } + + log::info!( + "[V2 Radio] Creating infinite radio from {} recent tracks: {:?}", + recent_track_ids.len(), + recent_track_ids + ); + + let client = state.client.read().await.clone(); + + let primary_track = client + .get_track(recent_track_ids[0]) + .await + .map_err(|e| format!("Failed to fetch primary track: {}", e))?; + + let artist_id = primary_track + .performer + .as_ref() + .map(|p| p.id) + .ok_or("Primary track has no artist")?; + + let session_id = tokio::task::spawn_blocking({ + let client = client.clone(); + move || -> Result { + let radio_db = crate::radio_engine::db::RadioDb::open_default()?; + let builder = crate::radio_engine::RadioPoolBuilder::new( + &radio_db, + &client, + crate::radio_engine::BuildRadioOptions::default(), + ); + let rt = tokio::runtime::Handle::current(); + let session = rt.block_on(builder.create_artist_radio(artist_id))?; + Ok(session.id) + } + }) + .await + .map_err(|e| format!("Infinite radio task failed: {}", e))??; + + log::info!("[V2 Radio] Infinite radio session created: {}", session_id); + + let track_ids = tokio::task::spawn_blocking({ + let session_id = session_id.clone(); + move || -> Result, String> { + let radio_db = crate::radio_engine::db::RadioDb::open_default()?; + let radio_engine = crate::radio_engine::RadioEngine::new(radio_db); + let mut ids = Vec::new(); + for _ in 0..60 { + match radio_engine.next_track(&session_id) { + Ok(radio_track) => ids.push(radio_track.track_id), + Err(_) => break, + } + } + Ok(ids.into_iter().take(50).collect()) + } + }) + .await + .map_err(|e| format!("Track generation task failed: {}", e))??; + + let client = state.client.read().await; + let mut tracks: Vec = Vec::new(); + let recent_ids_set: std::collections::HashSet = + recent_track_ids.iter().copied().collect(); + for next_track_id in track_ids { + if recent_ids_set.contains(&next_track_id) { + continue; + } + if let Ok(track) = client.get_track(next_track_id).await { + if let Some(ref performer) = track.performer { + if blacklist_state.is_blacklisted(performer.id) { + continue; + } + } + let core: CoreQueueTrack = track_to_queue_track_from_api(&track); + tracks.push(super::queue::V2QueueTrack { + id: core.id, + title: core.title, + artist: core.artist, + album: core.album, + duration_secs: core.duration_secs, + artwork_url: core.artwork_url, + hires: core.hires, + bit_depth: core.bit_depth, + sample_rate: core.sample_rate, + is_local: core.is_local, + album_id: core.album_id, + artist_id: core.artist_id, + streamable: core.streamable, + source: core.source, + parental_warning: core.parental_warning, + }); + } + } + + if tracks.is_empty() { + return Err("Failed to generate any infinite radio tracks".to_string()); + } + + log::info!("[V2 Radio] Returning {} infinite radio tracks", tracks.len()); + Ok(tracks) +} + fn track_to_queue_track_from_api(track: &crate::api::Track) -> CoreQueueTrack { let artwork_url = track .album diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index c72bb111b..7abe365f8 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1462,6 +1462,7 @@ pub fn run() { commands_v2::v2_create_album_radio, commands_v2::v2_create_qobuz_artist_radio, commands_v2::v2_create_qobuz_track_radio, + commands_v2::v2_create_infinite_radio, commands_v2::v2_delete_playlist_folder, commands_v2::v2_reorder_playlist_folders, commands_v2::v2_move_playlist_to_folder, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2231145b0..06664e87d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "QBZ", - "version": "1.2.5", + "version": "1.2.6", "identifier": "com.blitzfc.qbz", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/app.css b/src/app.css index 7f5d99869..4e66d5b2e 100644 --- a/src/app.css +++ b/src/app.css @@ -1267,6 +1267,198 @@ --alpha-95: rgba(0, 0, 0, 0.95); } +/* ── Accessibility: WCAG AAA Light ── */ +[data-theme="wcag-light"] { + --bg-primary: #ffffff; + --bg-secondary: #f5f5f5; + --bg-tertiary: #e8e8e8; + --bg-hover: #dcdcdc; + --text-primary: #1a1a1a; + --text-secondary: #2e2e2e; + --text-muted: #555555; + --text-disabled: #767676; + --accent-primary: #0055cc; + --accent-hover: #003d99; + --accent-active: #002e73; + --btn-primary-text: #ffffff; + --danger: #b30000; + --danger-bg: #fce8e8; + --danger-border: #e0a0a0; + --danger-hover: #990000; + --warning: #6b4c00; + --warning-bg: #fff3d0; + --warning-border: #d4a800; + --warning-hover: #543c00; + --border-subtle: #d0d0d0; + --border-strong: #8c8c8c; + --alpha-4: rgba(0, 0, 0, 0.04); + --alpha-6: rgba(0, 0, 0, 0.06); + --alpha-8: rgba(0, 0, 0, 0.08); + --alpha-10: rgba(0, 0, 0, 0.10); + --alpha-12: rgba(0, 0, 0, 0.12); + --alpha-15: rgba(0, 0, 0, 0.15); + --alpha-20: rgba(0, 0, 0, 0.20); + --alpha-25: rgba(0, 0, 0, 0.25); + --alpha-30: rgba(0, 0, 0, 0.30); + --alpha-35: rgba(0, 0, 0, 0.35); + --alpha-40: rgba(0, 0, 0, 0.40); + --alpha-45: rgba(0, 0, 0, 0.45); + --alpha-50: rgba(0, 0, 0, 0.50); + --alpha-55: rgba(0, 0, 0, 0.55); + --alpha-60: rgba(0, 0, 0, 0.60); + --alpha-65: rgba(0, 0, 0, 0.65); + --alpha-70: rgba(0, 0, 0, 0.70); + --alpha-75: rgba(0, 0, 0, 0.75); + --alpha-80: rgba(0, 0, 0, 0.80); + --alpha-85: rgba(0, 0, 0, 0.85); + --alpha-90: rgba(0, 0, 0, 0.90); + --alpha-95: rgba(0, 0, 0, 0.95); +} + +/* ── Accessibility: WCAG AAA Dark ── */ +[data-theme="wcag-dark"] { + --bg-primary: #121212; + --bg-secondary: #1e1e1e; + --bg-tertiary: #2a2a2a; + --bg-hover: #333333; + --text-primary: #ffffff; + --text-secondary: #e0e0e0; + --text-muted: #a0a0a0; + --text-disabled: #6b6b6b; + --accent-primary: #6ea8fe; + --accent-hover: #8dbbfe; + --accent-active: #a8ccfe; + --btn-primary-text: #0a0a0a; + --danger: #ff6b6b; + --danger-bg: #3d1414; + --danger-border: #7a2a2a; + --danger-hover: #ff8585; + --warning: #ffc45c; + --warning-bg: #3d2e0a; + --warning-border: #7a5c14; + --warning-hover: #ffd07a; + --border-subtle: #3a3a3a; + --border-strong: #6b6b6b; + --alpha-4: rgba(255, 255, 255, 0.04); + --alpha-6: rgba(255, 255, 255, 0.06); + --alpha-8: rgba(255, 255, 255, 0.08); + --alpha-10: rgba(255, 255, 255, 0.10); + --alpha-12: rgba(255, 255, 255, 0.12); + --alpha-15: rgba(255, 255, 255, 0.15); + --alpha-20: rgba(255, 255, 255, 0.20); + --alpha-25: rgba(255, 255, 255, 0.25); + --alpha-30: rgba(255, 255, 255, 0.30); + --alpha-35: rgba(255, 255, 255, 0.35); + --alpha-40: rgba(255, 255, 255, 0.40); + --alpha-45: rgba(255, 255, 255, 0.45); + --alpha-50: rgba(255, 255, 255, 0.50); + --alpha-55: rgba(255, 255, 255, 0.55); + --alpha-60: rgba(255, 255, 255, 0.60); + --alpha-65: rgba(255, 255, 255, 0.65); + --alpha-70: rgba(255, 255, 255, 0.70); + --alpha-75: rgba(255, 255, 255, 0.75); + --alpha-80: rgba(255, 255, 255, 0.80); + --alpha-85: rgba(255, 255, 255, 0.85); + --alpha-90: rgba(255, 255, 255, 0.90); + --alpha-95: rgba(255, 255, 255, 0.95); +} + +/* ── Accessibility: High Contrast ── */ +[data-theme="high-contrast"] { + --bg-primary: #000000; + --bg-secondary: #0a0a0a; + --bg-tertiary: #141414; + --bg-hover: #1f1f1f; + --text-primary: #ffffff; + --text-secondary: #f0f0f0; + --text-muted: #c8c8c8; + --text-disabled: #808080; + --accent-primary: #ffff00; + --accent-hover: #ffff55; + --accent-active: #ffff99; + --btn-primary-text: #000000; + --danger: #ff3333; + --danger-bg: #330000; + --danger-border: #ff3333; + --danger-hover: #ff6666; + --warning: #ffaa00; + --warning-bg: #332200; + --warning-border: #ffaa00; + --warning-hover: #ffcc44; + --border-subtle: #555555; + --border-strong: #ffffff; + --alpha-4: rgba(255, 255, 255, 0.04); + --alpha-6: rgba(255, 255, 255, 0.06); + --alpha-8: rgba(255, 255, 255, 0.08); + --alpha-10: rgba(255, 255, 255, 0.10); + --alpha-12: rgba(255, 255, 255, 0.12); + --alpha-15: rgba(255, 255, 255, 0.15); + --alpha-20: rgba(255, 255, 255, 0.20); + --alpha-25: rgba(255, 255, 255, 0.25); + --alpha-30: rgba(255, 255, 255, 0.30); + --alpha-35: rgba(255, 255, 255, 0.35); + --alpha-40: rgba(255, 255, 255, 0.40); + --alpha-45: rgba(255, 255, 255, 0.45); + --alpha-50: rgba(255, 255, 255, 0.50); + --alpha-55: rgba(255, 255, 255, 0.55); + --alpha-60: rgba(255, 255, 255, 0.60); + --alpha-65: rgba(255, 255, 255, 0.65); + --alpha-70: rgba(255, 255, 255, 0.70); + --alpha-75: rgba(255, 255, 255, 0.75); + --alpha-80: rgba(255, 255, 255, 0.80); + --alpha-85: rgba(255, 255, 255, 0.85); + --alpha-90: rgba(255, 255, 255, 0.90); + --alpha-95: rgba(255, 255, 255, 0.95); +} + +/* ── Accessibility: Colorblind (Deuteranopia-safe) ── */ +[data-theme="colorblind"] { + --bg-primary: #1a1a2e; + --bg-secondary: #22223a; + --bg-tertiary: #2c2c46; + --bg-hover: #363652; + --text-primary: #ffffff; + --text-secondary: #dcdce0; + --text-muted: #9e9eac; + --text-disabled: #64647a; + --accent-primary: #4a90d9; + --accent-hover: #6ba3e2; + --accent-active: #85b4e8; + --btn-primary-text: #0a0a14; + --danger: #cc79a7; + --danger-bg: #3a1a2e; + --danger-border: #8a4a70; + --danger-hover: #d993b8; + --warning: #e69f00; + --warning-bg: #3a2e00; + --warning-border: #8a6e00; + --warning-hover: #f0b630; + --border-subtle: #3e3e56; + --border-strong: #6e6e88; + --alpha-4: rgba(255, 255, 255, 0.04); + --alpha-6: rgba(255, 255, 255, 0.06); + --alpha-8: rgba(255, 255, 255, 0.08); + --alpha-10: rgba(255, 255, 255, 0.10); + --alpha-12: rgba(255, 255, 255, 0.12); + --alpha-15: rgba(255, 255, 255, 0.15); + --alpha-20: rgba(255, 255, 255, 0.20); + --alpha-25: rgba(255, 255, 255, 0.25); + --alpha-30: rgba(255, 255, 255, 0.30); + --alpha-35: rgba(255, 255, 255, 0.35); + --alpha-40: rgba(255, 255, 255, 0.40); + --alpha-45: rgba(255, 255, 255, 0.45); + --alpha-50: rgba(255, 255, 255, 0.50); + --alpha-55: rgba(255, 255, 255, 0.55); + --alpha-60: rgba(255, 255, 255, 0.60); + --alpha-65: rgba(255, 255, 255, 0.65); + --alpha-70: rgba(255, 255, 255, 0.70); + --alpha-75: rgba(255, 255, 255, 0.75); + --alpha-80: rgba(255, 255, 255, 0.80); + --alpha-85: rgba(255, 255, 255, 0.85); + --alpha-90: rgba(255, 255, 255, 0.90); + --alpha-95: rgba(255, 255, 255, 0.95); +} + * { margin: 0; padding: 0; diff --git a/src/lib/components/HorizontalScrollRow.svelte b/src/lib/components/HorizontalScrollRow.svelte index 882e9abf7..f0940aa71 100644 --- a/src/lib/components/HorizontalScrollRow.svelte +++ b/src/lib/components/HorizontalScrollRow.svelte @@ -11,6 +11,10 @@ let { title, header, children }: Props = $props(); let scrollContainer: HTMLDivElement; + let isDragging = $state(false); + let dragStartX = 0; + let dragStartScroll = 0; + let dragDistance = 0; function scroll(direction: 'left' | 'right') { if (scrollContainer) { @@ -27,6 +31,32 @@ } } + function onPointerDown(e: PointerEvent) { + if (e.button !== 0) return; + isDragging = true; + dragStartX = e.clientX; + dragStartScroll = scrollContainer.scrollLeft; + dragDistance = 0; + scrollContainer.setPointerCapture(e.pointerId); + } + + function onPointerMove(e: PointerEvent) { + if (!isDragging) return; + const dx = e.clientX - dragStartX; + dragDistance = Math.abs(dx); + scrollContainer.scrollLeft = dragStartScroll - dx; + } + + function onPointerUp(e: PointerEvent) { + if (!isDragging) return; + isDragging = false; + scrollContainer.releasePointerCapture(e.pointerId); + } + + function onClickCapture(e: MouseEvent) { + if (dragDistance > 5) e.preventDefault(); + } + const hasHeader = $derived(!!title || !!header); @@ -53,7 +83,17 @@ {/if} -
+ +
{@render children()}
@@ -113,6 +153,12 @@ .scroll-container { overflow-x: auto; overflow-y: hidden; + cursor: grab; + } + + .scroll-container.dragging { + cursor: grabbing; + user-select: none; } .content { diff --git a/src/lib/components/NowPlayingBar.svelte b/src/lib/components/NowPlayingBar.svelte index 000fd11bf..623fd02a2 100644 --- a/src/lib/components/NowPlayingBar.svelte +++ b/src/lib/components/NowPlayingBar.svelte @@ -453,85 +453,89 @@
- +
- {#if hasTrack} -
- + +
+
+ + {#if explicit} + + {/if}
- {/if} - - -
-
- - {#if explicit} - - {/if} -
-
- - {#if artist} - - {/if} - {#if artist && album} - · - {/if} - {#if album} - - {/if} +
+ + {#if artist} + + {/if} + {#if artist && album} + · + {/if} + {#if album} + + {/if} +
-
-
-
- -
- +
+
+ +
+ +
- {})} - busy={qconnectBusy} - compact={isNarrowBar} - />
-
- {:else} -
- {$translateStore('player.noTrackPlaying')} -
- {/if} + {:else} +
+ {$translateStore('player.noTrackPlaying')} +
+ {/if} +
+ + {})} + busy={qconnectBusy} + compact={isNarrowBar} + />
@@ -996,7 +1000,42 @@ flex: 1; display: flex; justify-content: center; + align-items: stretch; + gap: 8px; min-width: 0; + /* Reserve the same height the song-card takes (artwork 56px + 2px padding + top/bottom) so the always-visible QConnect badge can stretch to match + the badges-group height inside the song-card, even when no track is + playing or the responsive breakpoint kicks in. */ + min-height: 60px; + } + + .song-card-slot { + display: flex; + align-items: stretch; + flex: 1; + min-width: 354px; + max-width: 718px; + } + + .song-card-slot > .song-card, + .song-card-slot > .empty-state { + flex: 1; + } + + .song-card-slot > .empty-state { + display: flex; + align-items: center; + justify-content: center; + } + + /* Always-visible QConnect badge: stretch to the center-section height so it + matches the badges-group sizing inside the song-card. The badge wrapper + is a flex container with align-items: stretch, so its inner button (which + uses height: 100%) inherits the reserved 60px height. */ + .center-section > :global(.qconnect-badge-wrapper) { + align-self: stretch; + flex-shrink: 0; } /* ===== Control Buttons ===== */ diff --git a/src/lib/components/views/LoginView.svelte b/src/lib/components/views/LoginView.svelte index 09bebf061..953b4088a 100644 --- a/src/lib/components/views/LoginView.svelte +++ b/src/lib/components/views/LoginView.svelte @@ -488,7 +488,6 @@ width: 175px; height: 175px; object-fit: contain; - filter: drop-shadow(0 3px 14px color-mix(in srgb, var(--text-muted) 22%, transparent)); } .brand-name { diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index b4609d94d..184040f57 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -593,6 +593,11 @@ 'Frost': { value: 'frost', type: 'light' }, 'Langley': { value: 'langley', type: 'light' }, 'Kurosaki': { value: 'kurosaki', type: 'light' }, + // Accessibility themes + 'WCAG Light': { value: 'wcag-light', type: 'light' }, + 'WCAG Dark': { value: 'wcag-dark', type: 'dark' }, + 'High Contrast': { value: 'high-contrast', type: 'dark' }, + 'Colorblind': { value: 'colorblind', type: 'dark' }, }; // Generate maps from themes object for compatibility diff --git a/src/lib/i18n/locales/de.json b/src/lib/i18n/locales/de.json index 79953b115..ebe060d49 100644 --- a/src/lib/i18n/locales/de.json +++ b/src/lib/i18n/locales/de.json @@ -943,7 +943,11 @@ "langley": "Langley", "ayanami": "Ayanami", "iscariot": "Iscariot", - "system": "System" + "system": "System", + "wcagLight": "WCAG Hell", + "wcagDark": "WCAG Dunkel", + "highContrast": "Hoher Kontrast", + "colorblind": "Farbenblind" }, "autoTheme": "Auto-Theme", "autoThemeDesc": "Erstellt ein Farbschema aus deinem System-Hintergrundbild oder einem eigenen Bild", @@ -1636,6 +1640,7 @@ "addedTracksToQueue": "{count} Titel zur Warteschlange hinzugefügt", "failedPreviousTrack": "Zum vorherigen Titel wechseln fehlgeschlagen", "failedNextTrack": "Zum nächsten Titel wechseln fehlgeschlagen", + "failedToSavePreference": "Einstellung konnte nicht gespeichert werden", "tracksAddedToPlaylist": "Titel zur Playlist hinzugefügt", "playlistCreated": "Playlist erstellt", "offlineModeStarted": "Im Offline-Modus gestartet", diff --git a/src/lib/i18n/locales/en.json b/src/lib/i18n/locales/en.json index 0af6853eb..a3524f3cd 100644 --- a/src/lib/i18n/locales/en.json +++ b/src/lib/i18n/locales/en.json @@ -943,7 +943,11 @@ "langley": "Langley", "ayanami": "Ayanami", "iscariot": "Iscariot", - "system": "System" + "system": "System", + "wcagLight": "WCAG Light", + "wcagDark": "WCAG Dark", + "highContrast": "High Contrast", + "colorblind": "Colorblind" }, "autoTheme": "Auto-Theme", "autoThemeDesc": "Generate a color theme from your system wallpaper or a custom image", @@ -1666,6 +1670,7 @@ "addedTracksToQueue": "Added {count} tracks to queue", "failedPreviousTrack": "Failed to go to previous track", "failedNextTrack": "Failed to go to next track", + "failedToSavePreference": "Failed to save preference", "tracksAddedToPlaylist": "Track(s) added to playlist", "playlistCreated": "Playlist created", "playlistUpdated": "Playlist updated", diff --git a/src/lib/i18n/locales/es.json b/src/lib/i18n/locales/es.json index 54b2150d7..f4dc1355e 100644 --- a/src/lib/i18n/locales/es.json +++ b/src/lib/i18n/locales/es.json @@ -943,7 +943,11 @@ "langley": "Langley", "ayanami": "Ayanami", "iscariot": "Iscariot", - "system": "Sistema" + "system": "Sistema", + "wcagLight": "WCAG Claro", + "wcagDark": "WCAG Oscuro", + "highContrast": "Alto Contraste", + "colorblind": "Daltonismo" }, "autoTheme": "Tema Automatico", "autoThemeDesc": "Genera un tema de colores desde tu wallpaper del sistema o una imagen personalizada", @@ -1665,6 +1669,7 @@ "addedTracksToQueue": "{count} pistas agregadas a la cola", "failedPreviousTrack": "Error al ir a pista anterior", "failedNextTrack": "Error al ir a siguiente pista", + "failedToSavePreference": "Error al guardar preferencia", "tracksAddedToPlaylist": "Pista(s) agregada(s) a la playlist", "playlistCreated": "Playlist creada", "playlistUpdated": "Playlist actualizada", diff --git a/src/lib/i18n/locales/fr.json b/src/lib/i18n/locales/fr.json index c3689d575..ae3aa2d49 100644 --- a/src/lib/i18n/locales/fr.json +++ b/src/lib/i18n/locales/fr.json @@ -943,7 +943,11 @@ "langley": "Langley", "ayanami": "Ayanami", "iscariot": "Iscariot", - "system": "Systeme" + "system": "Systeme", + "wcagLight": "WCAG Clair", + "wcagDark": "WCAG Sombre", + "highContrast": "Contraste Élevé", + "colorblind": "Daltonien" }, "autoTheme": "Theme automatique", "autoThemeDesc": "Génère un thème de couleurs à partir de votre fond d'écran ou d'une image personnalisée", @@ -1636,6 +1640,7 @@ "addedTracksToQueue": "{count} titres ajoutés à la file d'attente", "failedPreviousTrack": "Impossible de revenir au titre précédent", "failedNextTrack": "Impossible de passer au titre suivant", + "failedToSavePreference": "Échec de l'enregistrement de la préférence", "tracksAddedToPlaylist": "Titre(s) ajouté(s) à la playlist", "playlistCreated": "Playlist créée", "offlineModeStarted": "Démarré en mode hors ligne", diff --git a/src/lib/i18n/locales/pt.json b/src/lib/i18n/locales/pt.json index 16c36afaf..aa64cff7f 100644 --- a/src/lib/i18n/locales/pt.json +++ b/src/lib/i18n/locales/pt.json @@ -943,7 +943,11 @@ "langley": "Langley", "ayanami": "Ayanami", "iscariot": "Iscariot", - "system": "Sistema" + "system": "Sistema", + "wcagLight": "WCAG Claro", + "wcagDark": "WCAG Escuro", + "highContrast": "Alto Contraste", + "colorblind": "Daltonismo" }, "autoTheme": "Tema Automático", "autoThemeDesc": "Gerar um tema de cores a partir do seu papel de parede ou de uma imagem personalizada", @@ -1659,6 +1663,7 @@ "addedTracksToQueue": "{count} faixas adicionadas à fila", "failedPreviousTrack": "Falha ao voltar à faixa anterior", "failedNextTrack": "Falha ao avançar para a próxima faixa", + "failedToSavePreference": "Falha ao salvar preferência", "tracksAddedToPlaylist": "Faixa(s) adicionada(s) à playlist", "playlistCreated": "Playlist criada", "playlistUpdated": "Playlist atualizada", diff --git a/src/lib/stores/playbackPreferencesStore.ts b/src/lib/stores/playbackPreferencesStore.ts index 5952368b7..65cb78cc3 100644 --- a/src/lib/stores/playbackPreferencesStore.ts +++ b/src/lib/stores/playbackPreferencesStore.ts @@ -9,7 +9,7 @@ import { skipIfRemote } from '$lib/services/commandRouter'; // ============ Types ============ -export type AutoplayMode = 'continue' | 'track_only'; +export type AutoplayMode = 'continue' | 'track_only' | 'infinite'; export interface PlaybackPreferences { autoplay_mode: AutoplayMode; @@ -99,6 +99,13 @@ export function isAutoplayEnabled(): boolean { return preferences.autoplay_mode === 'continue'; } +/** + * Check if infinite play (radio) is enabled + */ +export function isInfinitePlayEnabled(): boolean { + return preferences.autoplay_mode === 'infinite'; +} + /** * Subscribe to preference changes */ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 330f599b4..4babd6b59 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -55,7 +55,9 @@ import { initPlaybackPreferences, getCachedPreferences, - isAutoplayEnabled + isAutoplayEnabled, + isInfinitePlayEnabled, + setAutoplayMode } from '$lib/stores/playbackPreferencesStore'; import { initBlacklistStore, isBlacklisted as isArtistBlacklisted } from '$lib/stores/artistBlacklistStore'; import { initCustomArtistImageStore, clearCustomArtistImages } from '$lib/stores/customArtistImageStore'; @@ -2475,7 +2477,30 @@ setIsSkipping(true); try { - const nextTrackResult = await nextTrack(); + let nextTrackResult = await nextTrack(); + if (!nextTrackResult && infinitePlayEnabled) { + // Queue ended with infinite play on — fetch radio tracks based on + // the last 5 played + current track, append, then advance. + const recentIds: number[] = []; + if (playerState.currentTrack) recentIds.push(playerState.currentTrack.id); + for (const item of historyTracks.slice(0, 5)) { + const numericId = (item as any).trackId; + if (typeof numericId === 'number') recentIds.push(numericId); + } + if (recentIds.length > 0) { + try { + const radioTracks = await invoke('v2_create_infinite_radio', { + recentTrackIds: recentIds.slice(0, 5) + }); + if (radioTracks && radioTracks.length > 0) { + await invoke('v2_bulk_add_to_queue', { tracks: radioTracks }); + nextTrackResult = await nextTrack(); + } + } catch (err) { + console.error('Failed to extend queue with infinite radio:', err); + } + } + } if (nextTrackResult) { await playQueueTrack(nextTrackResult); } else { @@ -2700,15 +2725,16 @@ } // Toggle infinite play mode (auto-refill queue with similar tracks) - function handleToggleInfinitePlay() { - infinitePlayEnabled = !infinitePlayEnabled; - // Persist to localStorage + async function handleToggleInfinitePlay() { + const next = !infinitePlayEnabled; try { - setUserItem('qbz-infinite-play', JSON.stringify(infinitePlayEnabled)); - } catch { - // Ignore storage errors + await setAutoplayMode(next ? 'infinite' : 'continue'); + infinitePlayEnabled = next; + showToast(next ? $t('toast.infinitePlayEnabled') : $t('toast.infinitePlayDisabled'), 'info'); + } catch (err) { + console.error('Failed to set autoplay mode:', err); + showToast($t('toast.failedToSavePreference'), 'error'); } - showToast(infinitePlayEnabled ? $t('toast.infinitePlayEnabled') : $t('toast.infinitePlayDisabled'), 'info'); } // Play a track from history @@ -4125,15 +4151,7 @@ // Initialize playback context store (local state only, no backend calls) initPlaybackContextStore(); - // Load infinite play preference - try { - const stored = getUserItem('qbz-infinite-play'); - if (stored !== null) { - infinitePlayEnabled = JSON.parse(stored); - } - } catch { - // Ignore storage errors - } + infinitePlayEnabled = isInfinitePlayEnabled(); // NOTE: Audio settings are loaded AFTER session is ready (in handleLoginSuccess) // to avoid "No active session" errors from per-user state @@ -4489,14 +4507,38 @@ console.log('[Player] Auto-advance suppressed: QConnect is controlling playback'); return; } - if (!isAutoplayEnabled()) { + // Only `track_only` mode stops auto-advance. Both `continue` and `infinite` + // advance through the queue; `infinite` additionally refills it on end. + if (!isAutoplayEnabled() && !isInfinitePlayEnabled()) { setQueueEnded(true); await stopPlayback(); setIsPlaying(false); return; } const previousTrackId = currentTrack?.id ?? null; - const nextTrackResult = await nextTrackGuarded(); + let nextTrackResult = await nextTrackGuarded(); + if (!nextTrackResult && isInfinitePlayEnabled()) { + // Queue ended with infinite play on — extend with radio and retry. + const recentIds: number[] = []; + if (currentTrack) recentIds.push(currentTrack.id); + for (const item of historyTracks.slice(0, 5)) { + const numericId = (item as any).trackId; + if (typeof numericId === 'number') recentIds.push(numericId); + } + if (recentIds.length > 0) { + try { + const radioTracks = await invoke('v2_create_infinite_radio', { + recentTrackIds: recentIds.slice(0, 5) + }); + if (radioTracks && radioTracks.length > 0) { + await invoke('v2_bulk_add_to_queue', { tracks: radioTracks }); + nextTrackResult = await nextTrackGuarded(); + } + } catch (err) { + console.error('[Player] Auto-advance: infinite radio extend failed:', err); + } + } + } if (nextTrackResult) { // Defensive fallback for issue #80: // if backend returns same track on auto-advance while repeat-one is off, diff --git a/static/icons/AppIcons/android/144x144.png b/static/icons/AppIcons/android/144x144.png index 0137802b1..6fc510489 100644 Binary files a/static/icons/AppIcons/android/144x144.png and b/static/icons/AppIcons/android/144x144.png differ diff --git a/static/icons/AppIcons/android/192x192.png b/static/icons/AppIcons/android/192x192.png index 6a35b73bc..1be355395 100644 Binary files a/static/icons/AppIcons/android/192x192.png and b/static/icons/AppIcons/android/192x192.png differ diff --git a/static/icons/AppIcons/android/48x48.png b/static/icons/AppIcons/android/48x48.png index e420e2093..f2233ea89 100644 Binary files a/static/icons/AppIcons/android/48x48.png and b/static/icons/AppIcons/android/48x48.png differ diff --git a/static/icons/AppIcons/android/72x72.png b/static/icons/AppIcons/android/72x72.png index ffedfa5f8..8a76a2cee 100644 Binary files a/static/icons/AppIcons/android/72x72.png and b/static/icons/AppIcons/android/72x72.png differ diff --git a/static/icons/AppIcons/android/96x96.png b/static/icons/AppIcons/android/96x96.png index 3673e6831..37920348f 100644 Binary files a/static/icons/AppIcons/android/96x96.png and b/static/icons/AppIcons/android/96x96.png differ diff --git a/static/icons/AppIcons/android/mipmap-hdpi/ic_launcher.png b/static/icons/AppIcons/android/mipmap-hdpi/ic_launcher.png index ffedfa5f8..e5d9710fd 100644 Binary files a/static/icons/AppIcons/android/mipmap-hdpi/ic_launcher.png and b/static/icons/AppIcons/android/mipmap-hdpi/ic_launcher.png differ diff --git a/static/icons/AppIcons/android/mipmap-mdpi/ic_launcher.png b/static/icons/AppIcons/android/mipmap-mdpi/ic_launcher.png index e420e2093..5c036a165 100644 Binary files a/static/icons/AppIcons/android/mipmap-mdpi/ic_launcher.png and b/static/icons/AppIcons/android/mipmap-mdpi/ic_launcher.png differ diff --git a/static/icons/AppIcons/android/mipmap-xhdpi/ic_launcher.png b/static/icons/AppIcons/android/mipmap-xhdpi/ic_launcher.png index 3673e6831..4b36f062e 100644 Binary files a/static/icons/AppIcons/android/mipmap-xhdpi/ic_launcher.png and b/static/icons/AppIcons/android/mipmap-xhdpi/ic_launcher.png differ diff --git a/static/icons/AppIcons/android/mipmap-xxhdpi/ic_launcher.png b/static/icons/AppIcons/android/mipmap-xxhdpi/ic_launcher.png index 0137802b1..df8980a47 100644 Binary files a/static/icons/AppIcons/android/mipmap-xxhdpi/ic_launcher.png and b/static/icons/AppIcons/android/mipmap-xxhdpi/ic_launcher.png differ diff --git a/static/icons/AppIcons/android/mipmap-xxxhdpi/ic_launcher.png b/static/icons/AppIcons/android/mipmap-xxxhdpi/ic_launcher.png index 6a35b73bc..1170df423 100644 Binary files a/static/icons/AppIcons/android/mipmap-xxxhdpi/ic_launcher.png and b/static/icons/AppIcons/android/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/static/logo-hires.png b/static/logo-hires.png index f72a722ce..e839a3566 100644 Binary files a/static/logo-hires.png and b/static/logo-hires.png differ diff --git a/static/logo.png b/static/logo.png index f72a722ce..859d9a4cc 100644 Binary files a/static/logo.png and b/static/logo.png differ diff --git a/static/qbz-logo.png b/static/qbz-logo.png index f72a722ce..859d9a4cc 100644 Binary files a/static/qbz-logo.png and b/static/qbz-logo.png differ