diff --git a/src/mpd_now_playable/cli.py b/src/mpd_now_playable/cli.py index aa6a09a..8c41379 100644 --- a/src/mpd_now_playable/cli.py +++ b/src/mpd_now_playable/cli.py @@ -16,7 +16,7 @@ async def listen() -> None: listener = MpdStateListener() now_playing = CocoaNowPlaying(listener) - await listener.start(host=host, port=port, password=password) + await listener.start(hostname=host, port=port, password=password) await listener.loop(now_playing) diff --git a/stubs/MediaPlayer/__init__.pyi b/stubs/MediaPlayer/__init__.pyi index 4b793c4..a234bab 100644 --- a/stubs/MediaPlayer/__init__.pyi +++ b/stubs/MediaPlayer/__init__.pyi @@ -9,74 +9,56 @@ MPMusicPlaybackStatePlaying: Final = 1 MPMusicPlaybackStatePaused: Final = 2 MPMusicPlaybackState = Literal[0, 1, 2] -MPMediaItemPropertyAlbumTitle: Final = "albumTitle" -MPMediaItemPropertyAlbumTrackNumber: Final = "albumTrackNumber" -MPMediaItemPropertyDiscNumber: Final = "discNumber" -MPMediaItemPropertyGenre: Final = "genre" -MPMediaItemPropertyArtist: Final = "artist" -MPMediaItemPropertyComposer: Final = "composer" -MPMediaItemPropertyArtwork: Final = "artwork" -MPMediaItemPropertyPlaybackDuration: Final = "playbackDuration" -MPMediaItemPropertyPersistentID: Final = "persistentID" -MPMediaItemPropertyTitle: Final = "title" +MPMediaItemPropertyAlbumTitle: Final = 'albumTitle' +MPMediaItemPropertyArtist: Final = 'artist' +MPMediaItemPropertyArtwork: Final = 'artwork' +MPMediaItemPropertyPlaybackDuration: Final = 'playbackDuration' +MPMediaItemPropertyTitle: Final = 'title' -MPNowPlayingInfoPropertyMediaType: Final = "MPNowPlayingInfoPropertyMediaType" +MPNowPlayingInfoPropertyMediaType: Final = 'MPNowPlayingInfoPropertyMediaType' MPNowPlayingInfoMediaTypeAudio: Final = 1 MPNowPlayingInfoMediaTypeNone: Final = 0 -MPNowPlayingInfoPropertyPlaybackQueueCount: Final = ( - "MPNowPlayingInfoPropertyPlaybackQueueCount" -) -MPNowPlayingInfoPropertyPlaybackQueueIndex: Final = ( - "MPNowPlayingInfoPropertyPlaybackQueueIndex" -) -MPNowPlayingInfoPropertyElapsedPlaybackTime: Final = ( - "MPNowPlayingInfoPropertyElapsedPlaybackTime" -) -MPNowPlayingInfoPropertyExternalContentIdentifier: Final = ( - "MPNowPlayingInfoPropertyExternalContentIdentifier" -) +MPNowPlayingInfoPropertyElapsedPlaybackTime: Final = 'MPNowPlayingInfoPropertyElapsedPlaybackTime' class MPMediaItemArtwork: - @staticmethod - def alloc() -> type[MPMediaItemArtwork]: ... - @staticmethod - def initWithBoundsSize_requestHandler_( - size: CGSize, handler: Callable[[CGSize], NSImage] - ) -> MPMediaItemArtwork: ... + @staticmethod + def alloc() -> type[MPMediaItemArtwork]: ... + @staticmethod + def initWithBoundsSize_requestHandler_(size: CGSize, handler: Callable[[CGSize], NSImage]) -> MPMediaItemArtwork: ... class MPNowPlayingInfoCenter: - @staticmethod - def defaultCenter() -> MPNowPlayingInfoCenter: ... - def setNowPlayingInfo_(self, info: NSMutableDictionary) -> None: ... - def setPlaybackState_(self, state: MPMusicPlaybackState) -> None: ... + @staticmethod + def defaultCenter() -> MPNowPlayingInfoCenter: ... + + def setNowPlayingInfo_(self, info: NSMutableDictionary) -> None: ... + def setPlaybackState_(self, state: MPMusicPlaybackState) -> None: ... MPRemoteCommandHandlerStatusSuccess: Literal[0] = 0 MPRemoteCommandHandlerStatusCommandFailed: Literal[200] = 200 MPRemoteCommandHandlerStatus = Literal[0, 200] class MPRemoteCommandEvent: - pass + pass class MPRemoteCommand: - def setEnabled_(self, enabled: bool) -> None: ... - def removeTarget_(self, target: object) -> None: ... - def addTargetWithHandler_( - self, handler: Callable[[MPRemoteCommandEvent], MPRemoteCommandHandlerStatus] - ) -> None: ... + def setEnabled_(self, enabled: bool) -> None: ... + def removeTarget_(self, target: object) -> None: ... + def addTargetWithHandler_(self, handler: Callable[[MPRemoteCommandEvent], MPRemoteCommandHandlerStatus]) -> None: ... class MPRemoteCommandCenter: - @staticmethod - def sharedCommandCenter() -> MPRemoteCommandCenter: ... - def togglePlayPauseCommand(self) -> MPRemoteCommand: ... - def playCommand(self) -> MPRemoteCommand: ... - def pauseCommand(self) -> MPRemoteCommand: ... - def stopCommand(self) -> MPRemoteCommand: ... - def nextTrackCommand(self) -> MPRemoteCommand: ... - def previousTrackCommand(self) -> MPRemoteCommand: ... - def changePlaybackRateCommand(self) -> MPRemoteCommand: ... - def seekBackwardCommand(self) -> MPRemoteCommand: ... - def skipBackwardCommand(self) -> MPRemoteCommand: ... - def seekForwardCommand(self) -> MPRemoteCommand: ... - def skipForwardCommand(self) -> MPRemoteCommand: ... - def changePlaybackPositionCommand(self) -> MPRemoteCommand: ... + @staticmethod + def sharedCommandCenter() -> MPRemoteCommandCenter: ... + + def togglePlayPauseCommand(self) -> MPRemoteCommand: ... + def playCommand(self) -> MPRemoteCommand: ... + def pauseCommand(self) -> MPRemoteCommand: ... + def stopCommand(self) -> MPRemoteCommand: ... + def nextTrackCommand(self) -> MPRemoteCommand: ... + def previousTrackCommand(self) -> MPRemoteCommand: ... + def changePlaybackRateCommand(self) -> MPRemoteCommand: ... + def seekBackwardCommand(self) -> MPRemoteCommand: ... + def skipBackwardCommand(self) -> MPRemoteCommand: ... + def seekForwardCommand(self) -> MPRemoteCommand: ... + def skipForwardCommand(self) -> MPRemoteCommand: ... + def changePlaybackPositionCommand(self) -> MPRemoteCommand: ...