Support MPD_NOW_PLAYABLE_CACHE setting (Redis or Memcached)
This commit is contained in:
parent
c7773bf324
commit
55d82c72c3
7 changed files with 118 additions and 36 deletions
|
|
@ -11,10 +11,11 @@ async def listen() -> None:
|
|||
port = int(environ.get("MPD_PORT", "6600"))
|
||||
host = environ.get("MPD_HOST", "localhost")
|
||||
password = environ.get("MPD_PASSWORD")
|
||||
cache = environ.get("MPD_NOW_PLAYABLE_CACHE")
|
||||
if password is None and "@" in host:
|
||||
password, host = host.split("@", maxsplit=1)
|
||||
|
||||
listener = MpdStateListener()
|
||||
listener = MpdStateListener(cache)
|
||||
now_playing = CocoaNowPlaying(listener)
|
||||
await listener.start(host=host, port=port, password=password)
|
||||
await listener.loop(now_playing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue