src/bbc_meet_spotify/spotify.py
def add_songs_to_playlist(self, playlist_id: str, song_ids: List[str]):
        """
        Songs which are not currently in the playlist will be added.
        :param playlist_id: id for playlist
        :param song_ids: list of song ids
        :return:
        """
        playlist_info = self.spotify.user_playlist(self.username, playlist_id, "tracks")
        existing_songs = [x["track"]["id"] for x in playlist_info["tracks"]["items"]]
        new_song_ids = [song_id for song_id in song_ids if song_id not in existing_songs]
        try:
            self.spotify.user_playlist_add_tracks(self.username, playlist_id, new_song_ids)
        except SpotifyException as e:
            logger.info(f"No new songs were added to the playlist\n{e}")

        Songs which are not currently in the playlist will be added.
        :param playlist_id: id for playlist
        :param song_ids: list of song ids
        :return:
        
Songs which are not currently in the playlist will be added.
Songs which are not currently in the playlist will be added .
def add_songs_to_playlist(self, playlist_id: str, song_ids: List[str]):
        playlist_info = self.spotify.user_playlist(self.username, playlist_id, "tracks")
        existing_songs = [x["track"]["id"] for x in playlist_info["tracks"]["items"]]
        new_song_ids = [song_id for song_id in song_ids if song_id not in existing_songs]
        try:
            self.spotify.user_playlist_add_tracks(self.username, playlist_id, new_song_ids)
        except SpotifyException as e:
            logger.info(f"No new songs were added to the playlist\n{e}")
def add_songs_to_playlist ( self , playlist_id : str , song_ids : List [ str ] ) : playlist_info = self . spotify . user_playlist ( self . username , playlist_id , "tracks" ) existing_songs = [ x [ "track" ] [ "id" ] for x in playlist_info [ "tracks" ] [ "items" ] ] new_song_ids = [ song_id for song_id in song_ids if song_id not in existing_songs ] try : self . spotify . user_playlist_add_tracks ( self . username , playlist_id , new_song_ids ) except SpotifyException as e : logger . info ( f"No new songs were added to the playlist\n{e}" )
Songs which are not currently in the playlist will be added.
Songs which are not currently in the playlist will be added .
"""
        Songs which are not currently in the playlist will be added.
        :param playlist_id: id for playlist
        :param song_ids: list of song ids
        :return:
        """
None
self
playlist_id
str
id for playlist
id for playlist
song_ids
List[str]
list of song ids
list of song ids