0.2.0: play through Spotify Soloist
All checks were successful
release / release (push) Successful in 10m37s

Spotify refuses librespot the audio keys ("error audio key 0 1",
librespot #1649), so nothing played. Playback now goes through Spotify
Soloist, Spotify's own headless Linux player:

- The TV downloads it from Spotify (redistribution is not allowed), keeps
  it fresh (builds expire after 90 days), runs and restarts it, and drives
  it over its local WebSocket API; its events feed Most szól.
- It needs the user's own Soloist API key: the key screen shows a QR code
  to a small page on the TV where the phone pastes it (or type it on the
  TV); asked once after sign-in, also in Settings. Then the TV is picked
  once in the phone's Spotify app (pairing); home shows that step.
- Soloist is the Connect device; librespot only signs in (pairing code)
  and browses. Its player, Connect and zeroconf are gone, and with them
  GStreamer.
- A track from a list plays and the next ones are queued (Soloist's play
  takes one URI). The queue panel is back (Soloist reports the queue).
- Settings: the player's state and key instead of quality/normalisation/
  autoplay (Soloist decides those).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-11-03 21:50:44 +01:00
parent 5a76e56fe1
commit 7fd7e242a7
24 changed files with 1274 additions and 1268 deletions

View File

@@ -1,11 +1,12 @@
// Most szól: the cover, the title, the progress and the controls. With the
// lyrics open, the cover and the texts move to the left and a glass panel
// holds the lyrics on the right.
// lyrics or the queue open, the cover and the texts move to the left and a
// glass panel holds the lyrics / the queue on the right.
//
// Rust owns the focus: `button` is the focused button (0..6), `area` 1 means
// Rust owns the focus: `button` is the focused button (0..7), `area` 1 means
// the progress bar (left/right seek there).
import { Tv, GlassRect, GlassPane, Spinner, Caption } from "@sf-ui/sf-ui.slint";
import { QueueItem } from "types.slint";
import { SpIcon } from "icons.slint";
import { Accent, Equalizer } from "page.slint";
@@ -72,12 +73,14 @@ export component NowPlayingScreen inherits Rectangle {
in property <int> liked: -1;
in property <int> button: 2;
in property <int> area;
// 0 none, 1 lyrics
// 0 none, 1 lyrics, 2 queue
in property <int> panel;
in property <[string]> lyrics;
in property <int> lyric-line: -1;
in property <bool> lyrics-synced;
in property <string> lyrics-note;
in property <[QueueItem]> queue;
in property <string> queue-note;
in property <string> device;
// 0: the big layout, 1: side by side with the panel.
@@ -266,8 +269,9 @@ export component NowPlayingScreen inherits Rectangle {
Rectangle { width: root.mix(24, 6); }
b5 := NpButton { y: (parent.height - self.height) / 2; icon: root.liked == 1 ? "heart-filled" : "heart"; size: root.bs; on: root.liked == 1; focused: root.area == 0 && root.button == 5; alpha: root.alpha * (root.liked < 0 ? 0.4 : 1); }
b6 := NpButton { y: (parent.height - self.height) / 2; icon: "lyrics"; size: root.bs; on: root.panel == 1; focused: root.area == 0 && root.button == 6; alpha: root.alpha; }
b7 := NpButton { y: (parent.height - self.height) / 2; icon: "queue"; size: root.bs; on: root.panel == 2; focused: root.area == 0 && root.button == 7; alpha: root.alpha; }
}
property <[string]> hints: ["Keverés", "Előző", root.playing ? "Szünet" : "Lejátszás", "Következő", "Ismétlés", "Kedvelés", "Dalszöveg"];
property <[string]> hints: ["Keverés", "Előző", root.playing ? "Szünet" : "Lejátszás", "Következő", "Ismétlés", "Kedvelés", "Dalszöveg", "Lejátszási sor"];
Caption {
x: root.tx;
y: controls.y + controls.height + 18 * Tv.u;
@@ -276,7 +280,7 @@ export component NowPlayingScreen inherits Rectangle {
opacity: root.alpha;
}
// ---- the panel: lyrics ----
// ---- the panel: lyrics or the queue ----
property <float> pa: root.alpha * clamp(root.t * 1.6 - 0.6, 0, 1);
panel-pane := GlassPane {
x: 820 * Tv.u;
@@ -319,6 +323,66 @@ export component NowPlayingScreen inherits Rectangle {
wrap: word-wrap;
}
}
// queue
if root.panel == 2: Rectangle {
clip: true;
opacity: root.pa;
Text {
x: 56 * Tv.u;
y: 44 * Tv.u;
text: "Következik";
font-size: 38 * Tv.u;
font-weight: 700;
color: Tv.text;
}
for q[i] in root.queue: Rectangle {
x: 56 * Tv.u;
y: (120 + i * 84) * Tv.u;
width: parent.width - 112 * Tv.u;
height: 72 * Tv.u;
Rectangle {
x: 0;
width: 64 * Tv.u;
height: 64 * Tv.u;
y: 4 * Tv.u;
border-radius: 8 * Tv.u;
clip: true;
background: #1b1d24;
Image {
width: 100%;
height: 100%;
source: q.image;
image-fit: cover;
}
}
Text {
x: 88 * Tv.u;
y: 6 * Tv.u;
width: parent.width - 88 * Tv.u;
text: q.title;
font-size: 26 * Tv.u;
font-weight: 600;
color: Tv.text;
overflow: elide;
}
Text {
x: 88 * Tv.u;
y: 40 * Tv.u;
width: parent.width - 88 * Tv.u;
text: q.artist;
font-size: 21 * Tv.u;
color: Tv.text-tertiary;
overflow: elide;
}
}
if root.queue-note != "": Text {
x: 56 * Tv.u;
y: 130 * Tv.u;
text: root.queue-note;
font-size: 26 * Tv.u;
color: Tv.text-secondary;
}
}
}
out property <[GlassRect]> glass: [
@@ -335,7 +399,7 @@ export component NowPlayingScreen inherits Rectangle {
tint: #ffffff.with-alpha(0.14 + 0.1 * root.pf),
group: 0,
},
b0.glass, b1.glass, b2.glass, b3.glass, b4.glass, b5.glass, b6.glass,
b0.glass, b1.glass, b2.glass, b3.glass, b4.glass, b5.glass, b6.glass, b7.glass,
panel-pane.glass,
];
}