Example #1
0
 def __init__(self, sp: Spotify):
     Command.__init__(self, "Like",
                      "Add the currently playing song to Saved playlist",
                      "like")
     self.sp = sp
     # The rate limiter requires the same is_song_liked method to run for it to properly limit API requests
     self.liked = CheckFunctions(self.sp).is_song_liked
Example #2
0
 def __init__(self, sp: Spotify):
     Command.__init__(self, "Like",
                      "Add the current song to your liked songs", "heart",
                      PlaybackManager.toggle_like_song, "", "like", "exe")
     self.sp = sp
     # The rate limiter requires the same is_song_liked method to run for it to properly limit API requests
     self.liked = CheckFunctions(self.sp).is_song_liked
 def __init__(self, search_type: str):
     if search_type == "song":
         prefix = "play "
     else:
         prefix = f"{search_type} "
     Command.__init__(self, prefix, f"Search for a {search_type}", prefix)
     self.type_ = search_type
Example #4
0
 def __init__(self, sp: Spotify, type="song"):
     """
     Allows user to search online for songs/albums/artists/playlists/queue-songs
     :param sp: Spotify object from the spotipy library
     :param type: str of value 'song', 'queue', 'artist', 'playlist' or 'album'
     """
     # creates command and class variables
     func = PlaybackManager.play_song
     icon = "play"
     prefix = "🔎song "
     noun = type
     if type == "queue":
         func = PlaybackManager.queue_song
         icon = "list"
         prefix = "🔎queue "
         noun = "song"
     elif type == "playlist":
         func = PlaybackManager.play_playlist
         icon = type
         prefix = "🔎playlist "
         noun = type
     elif type == "album":
         func = PlaybackManager.play_album
         icon = type
         prefix = "🔎album "
         noun = type
     elif type == "artist":
         func = PlaybackManager.play_artist
         icon = type
         prefix = "🔎artist "
         noun = type
     Command.__init__(self, "Search", f"Searches for {noun} online", icon,
                      func, "", prefix, "fill")
     self.type = type
     self.icon = icon
     self.sp = sp
Example #5
0
 def __init__(self, sp: Spotify, spotifyplayer):
     Command.__init__(self, "Device", "Set the device to play music from", "device")
     self.spotifyplayer = spotifyplayer
     self.sp = sp
Example #6
0
 def __init__(self, sp: Spotify, spotifyplayer):
     Command.__init__(self, "Currently Playing",
                      "Show currently playing song", "currently playing")
     self.spotifyplayer = spotifyplayer
     self.sp = sp
Example #7
0
 def __init__(self, title: str, description: str, icon: str,
              function: classmethod, parameter: str, prefix: str,
              setting: str, _type: str):
     Command.__init__(self, title, description, icon, function, parameter,
                      prefix, setting)
     self._type = _type
Example #8
0
 def __init__(self):
     Command.__init__(self, "Authentication",
                      "Change Spotify API App Credentials",
                      "authentication")
Example #9
0
 def __init__(self):
     Command.__init__(
         self, "Share",
         "Copies to clipboard the Spotify URL of the song currently playing",
         "share")
Example #10
0
 def __init__(self):
     Command.__init__(self, "Repeat",
                      "Change the repeat state of your Spotify player",
                      "repeat")
 def __init__(self):
     Command.__init__(self, "Saved", "Plays saved/liked songs", "saved")
 def __init__(self):
     Command.__init__(self, "Resume", "Resumes playback", "resume")
 def __init__(self):
     Command.__init__(self, "Previous", "Plays previous song", "previous")
 def __init__(self):
     Command.__init__(self, "Next", "Skips current song", "next")
 def __init__(self):
     Command.__init__(self, "Pause", "Pauses playback", "pause")
Example #16
0
 def __init__(self, sp: Spotify):
     Command.__init__(self, "Shuffle", "Change Shuffle State", "shuffle")
     self.sp = sp
     # The rate limiter requires the same is_shuffle_on method to run for it to properly limit API requests
     self.check_shuffle = CheckFunctions(self.sp).is_shuffle_on
Example #17
0
 def __init__(self):
     Command.__init__(self, "Volume", "Set volume level from 1-10",
                      "volume ")
 def __init__(self, search_type: str, sp: Spotify):
     Command.__init__(self, "", "Search Online", f"🔎{search_type} ")
     self.sp = sp
     self.type_ = search_type
Example #19
0
 def __init__(self):
     Command.__init__(self, "Go to",
                      "Seek to a point in a song e.g. '2:10'", "go to ")
Example #20
0
 def __init__(self, sp: Spotify):
     Command.__init__(self, "Shuffle", "Change Shuffle State", "shuffle",
                      PlaybackManager.toggle_shuffle, "", "shuffle", "exe")
     self.sp = sp
     # The rate limiter requires the same is_song_liked method to run for it to properly limit API requests
     self.check_shuffle = CheckFunctions(self.sp).is_shuffle_on
Example #21
0
 def __init__(self):
     Command.__init__(self, "Exit", "Exits the Spotightlify application",
                      "exit")
 def __init__(self, title: str, description: str, icon: str,
              function: classmethod, parameter: str, prefix: str):
     Command.__init__(self, title, description, icon, function, parameter,
                      prefix, "fill")