Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cider/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

id = "dragged/cider"
name = "Cider"
version = "1.8.3"
version = "1.8.4"
plugin_api = 23
author = "dragged"
license = "MIT"
Expand Down
4 changes: 3 additions & 1 deletion cider/scripts/cider_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,9 @@ def _cache_artwork(self, url: str, cache_key: str = "") -> str:
if dest.exists() and dest.stat().st_size > 0:
return str(dest)
try:
resp = self._session.get(url, timeout=10)
# Tokened Session is only for Cider's local API. Artwork URLs are
# Apple Music CDN (*.mzstatic.com) — same bare get as LRCLIB.
resp = requests.get(url, timeout=10)
resp.raise_for_status()
if not resp.content:
return ""
Expand Down
14 changes: 11 additions & 3 deletions cider/scripts/test_lyrics_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,18 @@ def test_unsung_paint_is_next_grey_not_dim_white(self) -> None:
far = {"text": "thing", "start": 2_000, "end": 2_200}
unsung_line = cfg.token_rgba_for_paint(far, 2_000, 2_200, 0, paint)
self.assertAlmostEqual(unsung_line[0], cfg.NEXT_RGBA[0], places=2)
# Fixed palette so active vs sung stay distinct even when Noctalia
# theme tokens land on similar greens.
contrast = {
"sung": (1.0, 1.0, 1.0, 1.0),
"active": (1.0, 0.0, 0.0, 1.0),
"upcoming": cfg.NEXT_RGBA,
"next": cfg.NEXT_RGBA,
}
later = {"text": "thing", "start": 200, "end": 400}
live_future = cfg.token_rgba_for_paint(later, 0, 400, 80, paint)
self.assertAlmostEqual(live_future[1], paint["active"][1], places=2)
self.assertNotAlmostEqual(live_future[1], paint["sung"][1], places=1)
live_future = cfg.token_rgba_for_paint(later, 0, 400, 80, contrast)
self.assertAlmostEqual(live_future[1], contrast["active"][1], places=2)
self.assertNotAlmostEqual(live_future[1], contrast["sung"][1], places=1)
overlay = (ROOT / "scripts" / "lyrics_overlay.py").read_text(encoding="utf-8")
self.assertNotIn('self._mul_a(self._paint["sung"], alpha)', overlay)
self.assertIn("line_only_current_rgba", overlay)
Expand Down
7 changes: 7 additions & 0 deletions cider/scripts/test_write_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ def test_bridge_sends_apptoken_and_apitoken(self) -> None:
self.assertIn('self._session.headers["apptoken"]', text)
self.assertIn('self._session.headers["apitoken"]', text)

def test_artwork_cdn_fetch_is_tokenless(self) -> None:
source = Path(__file__).resolve().parent / "cider_bridge.py"
text = source.read_text(encoding="utf-8")
# Remote CDN must not reuse the Cider-token Session (ItsLemmy review).
self.assertIn("resp = requests.get(url, timeout=10)", text)
self.assertNotIn("self._session.get(url, timeout=10)", text)


if __name__ == "__main__":
unittest.main()
Loading