Compare commits
No commits in common. "413df0979de46466a2eca60b4df4f8f838c559d3" and "b41339a8c5d548da18142ec4cd9991cff8550a69" have entirely different histories.
413df0979d
...
b41339a8c5
4 changed files with 6 additions and 8 deletions
|
@ -104,7 +104,7 @@
|
||||||
"Queue": {
|
"Queue": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"current": {
|
"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",
|
"title": "Current",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,8 +9,8 @@ from .to_song import to_song
|
||||||
|
|
||||||
def to_queue(mpd: MpdState) -> Queue:
|
def to_queue(mpd: MpdState) -> Queue:
|
||||||
return Queue(
|
return Queue(
|
||||||
current=option_fmap(int, mpd.current.get("pos")),
|
current=int(mpd.current["pos"]),
|
||||||
next=int(mpd.status.get("nextsong", 0)),
|
next=int(mpd.status["nextsong"]),
|
||||||
length=int(mpd.status["playlistlength"]),
|
length=int(mpd.status["playlistlength"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,8 @@ from dataclasses import dataclass
|
||||||
|
|
||||||
@dataclass(slots=True)
|
@dataclass(slots=True)
|
||||||
class Queue:
|
class Queue:
|
||||||
#: The zero-based index of the current song in MPD's queue. If MPD is
|
#: The zero-based index of the current song in MPD's queue.
|
||||||
#: currently stopped, then there is no current song in the queue, indicated
|
current: int
|
||||||
#: by None.
|
|
||||||
current: int | None
|
|
||||||
#: The index of the next song to be played, taking into account random and
|
#: The index of the next song to be played, taking into account random and
|
||||||
#: repeat playback settings.
|
#: repeat playback settings.
|
||||||
next: int
|
next: int
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue