File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,19 +286,21 @@ class OfflinePlaylistService {
286286 return playlistSongs.any ((s) => s['ytid' ] == songId);
287287 });
288288
289- // Also check if song is in user's liked songs or custom playlists
289+ // Also check if song is in user's liked songs or OTHER custom playlists
290290 final isInLikedSongs = userLikedSongsList.any (
291291 (s) => s['ytid' ] == songId,
292292 );
293- final isInCustomPlaylists = getUserCustomPlaylists ().any ((p) {
293+ final isInOtherCustomPlaylists = getUserCustomPlaylists ()
294+ .where ((p) => p['ytid' ]? .toString () != normalizedPlaylistId)
295+ .any ((p) {
294296 final customPlaylistSongs = p['list' ] as List <dynamic >? ?? [];
295297 return customPlaylistSongs.any ((s) => s['ytid' ] == songId);
296298 });
297299
298300 // Only remove if not used elsewhere
299301 if (! isUsedInOtherPlaylists &&
300302 ! isInLikedSongs &&
301- ! isInCustomPlaylists ) {
303+ ! isInOtherCustomPlaylists ) {
302304 await removeSongFromOffline (songId);
303305 }
304306 } catch (e, stackTrace) {
You can’t perform that action at this time.
0 commit comments