0.1.1: browse through Spotify's internal endpoints
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:
Tamas Csikel
2026-11-03 18:15:02 +01:00
parent 3a66e0c7c7
commit 740397ea59
16 changed files with 1011 additions and 252 deletions

View File

@@ -12,7 +12,8 @@ The page engine and the controller come from Netflex TV (`fennec/netflex`); keep
app.toml store manifest (id support.bluefox.spotify; permissions network, gpu, audio)
src/main.rs window, glass layer (lists every exported [GlassRect]), images, controller
src/spotify.rs librespot: session, Spotify Connect (Spirc), sign-in (zeroconf + pairing code), player; Cmd in, Event out
src/api.rs Spotify Web API (browsing, library, search, queue), token from the session; short GET cache, 429 retry
src/api.rs the objects pages use, and Api: Internal (normal) or Web (Web API, only with SPOTIFY_MOCK)
src/internal.rs Spotify's internal endpoints via the session: metadata, playlists, /collection/v2, recently played, search, queue command
src/app.rs Controller: screen stack, keys, input/picker/toast, backdrop, sign-in screen, engine events, avatar
src/nowplaying.rs Most szól: playback state, controls, seek, lyrics, queue
src/page.rs the line-based page engine: lines (L) and chips (Ch) -> layout, focus, scroll, lazy images
@@ -28,12 +29,17 @@ src/format.rs Hungarian texts: times, counts, dates
src/task.rs blocking work on a thread, result on the UI thread
ui/app.slint root: screen fades, one FocusScope -> Rust `key`, glass exports
ui/page.slint LinePage: draws the lines Rust lays out (nav, now playing capsule, avatar, keyboard)
ui/nowplaying.slint the now playing screen and its panel (lyrics / queue)
ui/nowplaying.slint the now playing screen and its lyrics panel
ui/signin.slint ConnectScreen (QR code + Spotify app), InputScreen, MessageScreen
ui/icons.slint SpIcon: shuffle, repeat, heart, lyrics, queue, devices (+ sf-ui's icons)
tools/mock_server.py stand-in Web API with made-up data (with SPOTIFY_MOCK=1: no librespot)
```
The public Web API is not used against Spotify: librespot's client id gets 429 (rate limit) on every call. Browsing goes through `internal.rs`.
```
```
## Rules of this codebase
- **Rust owns state and focus.** Slint only draws. Every key goes to `Controller::key`, except while an on-screen keyboard has the focus.