diff --git a/schemata/playback-v1.json b/schemata/playback-v1.json index 7c97aa4..29c2300 100644 --- a/schemata/playback-v1.json +++ b/schemata/playback-v1.json @@ -104,7 +104,7 @@ "Queue": { "properties": { "current": { - "description": "The zero-based index of the current song in MPD's queue. If MPD is currently stopped, then there is no current song in the queue, indicated by None.", + "description": "The zero-based index of the current song in MPD's queue.", "title": "Current", "type": "integer" }, diff --git a/src/mpd_now_playable/mpd/convert/to_playback.py b/src/mpd_now_playable/mpd/convert/to_playback.py index 77adfa2..29b2223 100644 --- a/src/mpd_now_playable/mpd/convert/to_playback.py +++ b/src/mpd_now_playable/mpd/convert/to_playback.py @@ -9,8 +9,8 @@ from .to_song import to_song def to_queue(mpd: MpdState) -> Queue: return Queue( - current=option_fmap(int, mpd.current.get("pos")), - next=int(mpd.status.get("nextsong", 0)), + current=int(mpd.current["pos"]), + next=int(mpd.status["nextsong"]), length=int(mpd.status["playlistlength"]), ) diff --git a/src/mpd_now_playable/playback/queue.py b/src/mpd_now_playable/playback/queue.py index df5e76c..7c93741 100644 --- a/src/mpd_now_playable/playback/queue.py +++ b/src/mpd_now_playable/playback/queue.py @@ -3,10 +3,8 @@ from dataclasses import dataclass @dataclass(slots=True) class Queue: - #: The zero-based index of the current song in MPD's queue. If MPD is - #: currently stopped, then there is no current song in the queue, indicated - #: by None. - current: int | None + #: The zero-based index of the current song in MPD's queue. + current: int #: The index of the next song to be played, taking into account random and #: repeat playback settings. next: int diff --git a/src/mpd_now_playable/receivers/cocoa/convert/to_nsimage.py b/src/mpd_now_playable/receivers/cocoa/convert/to_nsimage.py index e8544ed..213914d 100644 --- a/src/mpd_now_playable/receivers/cocoa/convert/to_nsimage.py +++ b/src/mpd_now_playable/receivers/cocoa/convert/to_nsimage.py @@ -37,4 +37,4 @@ def ns_image_to_media_item_artwork(img: NSImage) -> MPMediaItemArtwork: ) -MPD_LOGO = ns_image_to_media_item_artwork(logo_to_ns_image()) +MPD_LOGO = logo_to_ns_image()