예제 #1
0
 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")
예제 #2
0
 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")
예제 #3
0
 def __init__(self, spotify):
     super().__init__(getCommandName("RESUME_COMMAND"), spotify)
예제 #4
0
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)
예제 #5
0
 def __init__(self, spotify):
     try:
         super().__init__(getCommandName("LOGOUT_COMMAND"), spotify)
     except RuntimeError:
         pass
예제 #6
0
 def __init__(self, spotify):
     super().__init__(getCommandName("DECREASE_VOLUME_COMMAND"), spotify)
예제 #7
0
 def __init__(self, spotify):
     super().__init__(getCommandName("PODCAST_COMMAND"), spotify)
예제 #8
0
 def __init__(self, spotify):
     super().__init__(getCommandName("CURRENT_TRACK_INFO_COMMAND"), spotify)
예제 #9
0
 def __init__(self, spotify):
     super().__init__(getCommandName("PREVIOUS_COMMAND"), spotify)
예제 #10
0
 def __init__(self, spotify):
     self.command = getCommandName("EDIT_CONFIG_COMMAND")
예제 #11
0
 def __init__(self, spotify):
     super().__init__(getCommandName('PLAY_COMMAND'), spotify)
예제 #12
0
 def __init__(self, spotify):
     super().__init__(getCommandName("DECREASE_VOLUME_COMMAND"), spotify)
     self.currentVolume = self.spotify.current_playback(
     )["device"]["volume_percent"]
예제 #13
0
 def __init__(self, spotify):
     super().__init__(getCommandName("PLAY_MY_PLAYLIST_COMMAND"), spotify)
예제 #14
0
 def __init__(self, spotify):
     super().__init__(getCommandName("ADD_TO_QUEUE_COMMAND"), spotify)
예제 #15
0
 def __init__(self, spotify):
     super().__init__(getCommandName("PLAY_SONG_BY_ARTIST_COMMAND"),
                      spotify)
예제 #16
0
 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, {})]
예제 #17
0
 def __init__(self, spotify):
     super().__init__(getCommandName("FAST_FORWARD_COMMAND"), spotify)
예제 #18
0
 def __init__(self, spotify):
     try:
         super().__init__(getCommandName("START_SPOTIFY_COMMAND"), spotify)
         self.spotifyStarted = True
     except RuntimeError:
         self.spotifyStarted = False