Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 8
0
 def __init__(self):
     Command.__init__(self, "Authentication",
                      "Change Spotify API App Credentials",
                      "authentication")
Ejemplo n.º 9
0
 def __init__(self):
     Command.__init__(
         self, "Share",
         "Copies to clipboard the Spotify URL of the song currently playing",
         "share")
Ejemplo n.º 10
0
 def __init__(self):
     Command.__init__(self, "Repeat",
                      "Change the repeat state of your Spotify player",
                      "repeat")
Ejemplo n.º 11
0
 def __init__(self):
     Command.__init__(self, "Saved", "Plays saved/liked songs", "saved")
Ejemplo n.º 12
0
 def __init__(self):
     Command.__init__(self, "Resume", "Resumes playback", "resume")
Ejemplo n.º 13
0
 def __init__(self):
     Command.__init__(self, "Previous", "Plays previous song", "previous")
Ejemplo n.º 14
0
 def __init__(self):
     Command.__init__(self, "Next", "Skips current song", "next")
Ejemplo n.º 15
0
 def __init__(self):
     Command.__init__(self, "Pause", "Pauses playback", "pause")
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 19
0
 def __init__(self):
     Command.__init__(self, "Go to",
                      "Seek to a point in a song e.g. '2:10'", "go to ")
Ejemplo n.º 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
Ejemplo n.º 21
0
 def __init__(self):
     Command.__init__(self, "Exit", "Exits the Spotightlify application",
                      "exit")
Ejemplo n.º 22
0
 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")