Find the current song's URL and pass it on when possible
This commit is contained in:
parent
b8bcdc5a83
commit
d9c8e0fe28
9 changed files with 79 additions and 21 deletions
|
@ -25,6 +25,7 @@ from MediaPlayer import (
|
|||
MPNowPlayingInfoCenter,
|
||||
MPNowPlayingInfoMediaTypeAudio,
|
||||
MPNowPlayingInfoMediaTypeNone,
|
||||
MPNowPlayingInfoPropertyAssetURL,
|
||||
MPNowPlayingInfoPropertyElapsedPlaybackTime,
|
||||
MPNowPlayingInfoPropertyExternalContentIdentifier,
|
||||
MPNowPlayingInfoPropertyMediaType,
|
||||
|
@ -106,6 +107,9 @@ def song_to_media_item(song: Song) -> NSMutableDictionary:
|
|||
nowplaying_info[MPMediaItemPropertyComposer] = join_plural_field(song.composer)
|
||||
nowplaying_info[MPMediaItemPropertyPlaybackDuration] = song.duration
|
||||
|
||||
if song.url is not None:
|
||||
nowplaying_info[MPNowPlayingInfoPropertyAssetURL] = song.url.human_repr()
|
||||
|
||||
# MPD can't play back music at different rates, so we just want to set it
|
||||
# to 1.0 if the song is playing. (Leave it at 0.0 if the song is paused.)
|
||||
if song.state == PlaybackState.play:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue