File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,10 @@ def remove_library():
179
179
except Exception :
180
180
logging .exception ("Failed to get library singles." )
181
181
library_songs = []
182
- # Filter for unique album IDs so that for each song, we can just remove the album its a part of
183
- filtered_songs = list ({v ["album" ]["id" ]: v for v in library_songs }.values ())
182
+ # Filter out songs where album is None (possible rare occurrence seen here: https://github.com/apastel/ytmusic-deleter/issues/12)
183
+ filtered_songs = list (filter (lambda song : song ["album" ], library_songs ))
184
+ # Filter for unique album IDs so that for each song, we can just remove the album it's a part of
185
+ filtered_songs = list ({v ["album" ]["id" ]: v for v in filtered_songs }.values ())
184
186
progress_bar = manager .counter (total = len (filtered_songs ), desc = "Singles Processed" , unit = "singles" )
185
187
albums_removed += remove_library_albums_by_song (filtered_songs , progress_bar )
186
188
logging .info (
You can’t perform that action at this time.
0 commit comments