Compare commits
2 commits
b41339a8c5
...
413df0979d
Author | SHA1 | Date | |
---|---|---|---|
413df0979d | |||
7dfd3f85e4 |
4 changed files with 8 additions and 6 deletions
schemata
src/mpd_now_playable
|
@ -104,7 +104,7 @@
|
|||
"Queue": {
|
||||
"properties": {
|
||||
"current": {
|
||||
"description": "The zero-based index of the current song in MPD's queue.",
|
||||
"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.",
|
||||
"title": "Current",
|
||||
"type": "integer"
|
||||
},
|
||||
|
|
|
@ -9,8 +9,8 @@ from .to_song import to_song
|
|||
|
||||
def to_queue(mpd: MpdState) -> Queue:
|
||||
return Queue(
|
||||
current=int(mpd.current["pos"]),
|
||||
next=int(mpd.status["nextsong"]),
|
||||
current=option_fmap(int, mpd.current.get("pos")),
|
||||
next=int(mpd.status.get("nextsong", 0)),
|
||||
length=int(mpd.status["playlistlength"]),
|
||||
)
|
||||
|
||||
|
|
|
@ -3,8 +3,10 @@ from dataclasses import dataclass
|
|||
|
||||
@dataclass(slots=True)
|
||||
class Queue:
|
||||
#: The zero-based index of the current song in MPD's queue.
|
||||
current: int
|
||||
#: 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 index of the next song to be played, taking into account random and
|
||||
#: repeat playback settings.
|
||||
next: int
|
||||
|
|
|
@ -37,4 +37,4 @@ def ns_image_to_media_item_artwork(img: NSImage) -> MPMediaItemArtwork:
|
|||
)
|
||||
|
||||
|
||||
MPD_LOGO = logo_to_ns_image()
|
||||
MPD_LOGO = ns_image_to_media_item_artwork(logo_to_ns_image())
|
||||
|
|
Loading…
Add table
Reference in a new issue