0.1.1: browse through Spotify's internal endpoints
Some checks failed
release / release (push) Failing after 13s
Some checks failed
release / release (push) Failing after 13s
The public Web API answers librespot's client id with 429 on every call (and the old keymaster token endpoint with 403), so every page failed. Browsing now goes through the same librespot session as playback: metadata, /playlist/v2 (rootlist and lists), /collection/v2 (liked songs, saved albums, followed artists and podcasts; save and like too), recently played, the search context, and a Connect command for the queue. - Home: recently played albums/playlists/artists, your playlists, your artists, saved albums, podcasts (no top lists or new releases there). - Search finds songs; artists and albums come from them. - Playlists without a picture get Spotify's mosaic cover. - The queue panel is gone (the internal API does not show the queue). - The Web API client stays for the mock server only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
// Most szól: the cover, the title, the progress and the controls. With the
|
||||
// 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.
|
||||
// lyrics open, the cover and the texts move to the left and a glass panel
|
||||
// holds the lyrics on the right.
|
||||
//
|
||||
// Rust owns the focus: `button` is the focused button (0..7), `area` 1 means
|
||||
// Rust owns the focus: `button` is the focused button (0..6), `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";
|
||||
|
||||
@@ -73,14 +72,12 @@ export component NowPlayingScreen inherits Rectangle {
|
||||
in property <int> liked: -1;
|
||||
in property <int> button: 2;
|
||||
in property <int> area;
|
||||
// 0 none, 1 lyrics, 2 queue
|
||||
// 0 none, 1 lyrics
|
||||
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.
|
||||
@@ -269,9 +266,8 @@ 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", "Lejátszási sor"];
|
||||
property <[string]> hints: ["Keverés", "Előző", root.playing ? "Szünet" : "Lejátszás", "Következő", "Ismétlés", "Kedvelés", "Dalszöveg"];
|
||||
Caption {
|
||||
x: root.tx;
|
||||
y: controls.y + controls.height + 18 * Tv.u;
|
||||
@@ -280,7 +276,7 @@ export component NowPlayingScreen inherits Rectangle {
|
||||
opacity: root.alpha;
|
||||
}
|
||||
|
||||
// ---- the panel: lyrics or the queue ----
|
||||
// ---- the panel: lyrics ----
|
||||
property <float> pa: root.alpha * clamp(root.t * 1.6 - 0.6, 0, 1);
|
||||
panel-pane := GlassPane {
|
||||
x: 820 * Tv.u;
|
||||
@@ -323,66 +319,6 @@ 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: [
|
||||
@@ -399,7 +335,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, b7.glass,
|
||||
b0.glass, b1.glass, b2.glass, b3.glass, b4.glass, b5.glass, b6.glass,
|
||||
panel-pane.glass,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user