def executeCommand(self, command: str): if (getSetting("CASE_SENSITIVE") == "False"): command = command.upper() if (command == getCommandName("PLAY_SONG_COMMAND")): return Song(self.spotify) elif (command == getCommandName("PLAY_SONG_BY_ARTIST_COMMAND")): return ArtistSong(self.spotify) raise RuntimeError("Incorrect command")
def executeCommand(self, command: str): if (getSetting("CASE_SENSITIVE") == "False"): command = command.upper() if (command == getCommandName('PLAY_SONG_COMMAND')): return Song(self.spotify) elif (command == getCommandName('PLAY_SONG_BY_ARTIST_COMMAND')): return ArtistSong(self.spotify) elif (command == getCommandName('PLAY_FEATURED_PLAYLIST_COMMAND')): return FeaturedPlaylist(self.spotify) elif (command == getCommandName('PLAY_PLAYLIST_COMMAND')): return Playlist(self.spotify) elif (command == getCommandName('PLAY_MY_PLAYLIST_COMMAND')): return MyPlaylist(self.spotify) raise RuntimeError("Incorrect command")
def __init__(self, spotify): super().__init__(getCommandName("RESUME_COMMAND"), spotify)
def executeCommand(command, spotify): if(command == getCommandName("NEXT_COMMAND")): return Next(spotify) elif(command == getCommandName("PREVIOUS_COMMAND")): return Previous(spotify) elif(command == getCommandName("PAUSE_COMMAND")): return Pause(spotify) elif(command == getCommandName("RESUME_COMMAND")): return Resume(spotify) elif(command == getCommandName("DECREASE_VOLUME_COMMAND")): return DecreaseVolume(spotify) elif(command == getCommandName("INCREASE_VOLUME_COMMAND")): return IncreaseVolume(spotify) elif(command == getCommandName("PLAY_COMMAND")): return Play(spotify) elif(command == getCommandName("ADD_TO_QUEUE_COMMAND")): return AddToQueue(spotify) elif(command == getCommandName("START_SPOTIFY_COMMAND")): return StartSpotify(spotify) elif(command == getCommandName("LOGOUT_COMMAND")): return Logout(spotify) elif(command == getCommandName("LOGIN_COMMAND")): return Login(spotify) elif(command == getCommandName("CURRENT_TRACK_INFO_COMMAND")): return CurrentTrackInfo(spotify) elif(command == getCommandName("RELOAD_CONFIG_COMMAND")): return ReloadConfig(spotify) elif(command == getCommandName("EDIT_CONFIG_COMMAND")): return EditConfig(spotify)
def __init__(self, spotify): try: super().__init__(getCommandName("LOGOUT_COMMAND"), spotify) except RuntimeError: pass
def __init__(self, spotify): super().__init__(getCommandName("DECREASE_VOLUME_COMMAND"), spotify)
def __init__(self, spotify): super().__init__(getCommandName("PODCAST_COMMAND"), spotify)
def __init__(self, spotify): super().__init__(getCommandName("CURRENT_TRACK_INFO_COMMAND"), spotify)
def __init__(self, spotify): super().__init__(getCommandName("PREVIOUS_COMMAND"), spotify)
def __init__(self, spotify): self.command = getCommandName("EDIT_CONFIG_COMMAND")
def __init__(self, spotify): super().__init__(getCommandName('PLAY_COMMAND'), spotify)
def __init__(self, spotify): super().__init__(getCommandName("DECREASE_VOLUME_COMMAND"), spotify) self.currentVolume = self.spotify.current_playback( )["device"]["volume_percent"]
def __init__(self, spotify): super().__init__(getCommandName("PLAY_MY_PLAYLIST_COMMAND"), spotify)
def __init__(self, spotify): super().__init__(getCommandName("ADD_TO_QUEUE_COMMAND"), spotify)
def __init__(self, spotify): super().__init__(getCommandName("PLAY_SONG_BY_ARTIST_COMMAND"), spotify)
def Match(self, query: str): if (not os.path.isfile(getSetting("CACHE_PATH"))): return [(getCommandName("LOGIN_COMMAND"), "Log into Spotify", "Spotify", 100, 100, {})] else: return [("", "Already logged in", "Spotify", 100, 100, {})]
def __init__(self, spotify): super().__init__(getCommandName("FAST_FORWARD_COMMAND"), spotify)
def __init__(self, spotify): try: super().__init__(getCommandName("START_SPOTIFY_COMMAND"), spotify) self.spotifyStarted = True except RuntimeError: self.spotifyStarted = False