@@ -61,6 +61,7 @@ def migrate(
6161 SpotifyPlaylistCollection | TidalPlaylistCollection ,
6262 ] = {}
6363 existing_playlists_to_service = {pl .name : pl for pl in to_service .library .playlists }
64+ # TODO: It would be nice to have a playlist picker here
6465 for from_playlist in from_service .library .playlists :
6566 # Get or create playlist with user feedback for overwrite
6667 to_playlist = existing_playlists_to_service .get (from_playlist .name )
@@ -102,16 +103,20 @@ def migrate(
102103 f"Found { len (list (filter (None , matched_tracks )))} of { len (matched_tracks )} "
103104 f"tracks on { to_service .name } ."
104105 )
105- for from_track , to_track in zip (from_playlist .tracks , matched_tracks ):
106- if to_track is None :
107- log .warning (
108- f"Couldn't find '{ from_track .title } - { from_track .primary_artist } ' "
109- f"on { to_service .name !r} "
110- )
111- else :
112- to_playlist .tracks .append (
113- to_service .playlist_track (to_track ), # type: ignore[arg-type]
114- )
106+ with to_playlist .remote_edit ():
107+ for from_track , to_track in zip (from_playlist .tracks , matched_tracks ):
108+ if to_track is None :
109+ log .warning (
110+ f"Couldn't find '{ from_track .title } "
111+ f"- { from_track .primary_artist } ' "
112+ f"on { to_service .name !r} "
113+ )
114+ else :
115+ to_playlist .tracks .append (
116+ to_service .playlist_track (to_track ), # type: ignore[arg-type]
117+ )
118+
119+ log .info (f"Successfully migrated { from_playlist .name !r} ." )
115120
116121
117122service_mapping : dict [str , type [SpotifyService ] | type [TidalService ]] = {
0 commit comments