Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 23 lines 546 B view raw
1"""Shared client factory used by every example. 2 3Override the host/port via env: ``ROCKBOX_HOST``, ``ROCKBOX_PORT``. 4""" 5 6from __future__ import annotations 7 8import os 9 10from rockbox_sdk import RockboxClient 11 12 13def create_client() -> RockboxClient: 14 return RockboxClient( 15 host=os.environ.get("ROCKBOX_HOST", "localhost"), 16 port=int(os.environ.get("ROCKBOX_PORT", "6062")), 17 ) 18 19 20def fmt_time(ms: int) -> str: 21 """Format milliseconds as ``M:SS``.""" 22 total = max(0, ms // 1000) 23 return f"{total // 60}:{total % 60:02d}"