Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnAudioQuery.removeFromPlaylist returns true but song is not being removed from playlist #141

Open
DocentSzachista opened this issue Jan 11, 2024 · 2 comments

Comments

@DocentSzachista
Copy link

DocentSzachista commented Jan 11, 2024

AS said in the topic, function returns true but the song isnt being removed from playlist. I am using lib in version 2.9.0
Relevant code fragment:

 IconButton(
                      icon: const Icon(Icons.delete, size: 24,),
                      onPressed: () async {
                        final removed = await widget.audioQuery.removeFromPlaylist(playlist.id, songs[index].id);
                        print(removed);
                        if(removed) {
                          setState(() {});
                        }
                      },
                    ),

where songs[index].id is a element from list of SongModel objects, and playlist is an instance of PlaylistModel

@NikolaKuzmanovski
Copy link

NikolaKuzmanovski commented Feb 14, 2024

I've encountered the same issue

final allPlaylists = await audioQuery.queryPlaylists();
print("allPlaylists ${allPlaylists[0].id}"); //1000000076

final playlistTracks = await audioQuery.queryAudiosFrom(AudiosFromType.PLAYLIST, allPlaylists[0].id);
print("playlistTracks ${playlistTracks[0].id}"); //playlistTracks 1

final isRemoved = await audioQuery.removeFromPlaylist(allPlaylists[0].id, playlistTracks[0].id);
print("isRemovd $isRemoved"); //isRemovd true

@aldaineclarke
Copy link

I have the same issue on my end as well.
I have checked the playlist songs with queryAudiosFrom() method and confirm that the song exists in the playlist.
However the song is not removed from the playlist, even though response from the removeFromPlaylist() is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants