Display mpd-now-playable version on launch

This commit is contained in:
Danielle McLean 2024-06-22 13:17:14 +10:00
parent fd7866ed14
commit 796e3df87d
Signed by: 00dani
GPG key ID: 6854781A0488421C
3 changed files with 5 additions and 0 deletions

View file

@ -48,6 +48,8 @@ check = {composite = ['lint', 'typecheck']}
[tool.pdm.version]
source = "scm"
write_to = 'mpd_now_playable/__version__.py'
write_template = "__version__ = '{}'"
[build-system]
requires = ["pdm-backend"]

View file

@ -0,0 +1 @@
__version__ = '0.0.1'

View file

@ -3,6 +3,7 @@ from os import environ
from corefoundationasyncio import CoreFoundationEventLoop
from .__version__ import __version__
from .cocoa.now_playing import CocoaNowPlaying
from .mpd.listener import MpdStateListener
@ -15,6 +16,7 @@ async def listen() -> None:
if password is None and "@" in host:
password, host = host.split("@", maxsplit=1)
print(f"mpd-now-playable v{__version__}")
listener = MpdStateListener(cache)
now_playing = CocoaNowPlaying(listener)
await listener.start(host=host, port=port, password=password)