LucJosin / on_audio_query

Flutter Plugin used to query audios/songs infos [title, artist, album, etc..] from device storage.
https://pub.dev/packages/on_audio_query
42 stars 27 forks source link

When importing MP3 data, some images appear blank and give the warning I wrote below, as a result of which the application slows down a lot. #136

Open yusuff122 opened 7 months ago

yusuff122 commented 7 months ago

E/MediaMetadataRetrieverJNI(21416): getEmbeddedPicture: Call to getEmbeddedPicture failed. Lost connection to device.

    Future<void> fetchMusic() async {
       _audioQuery = OnAudioQuery();
     _musicList = await _audioQuery.querySongs(
          sortType: SongSortType.DATE_ADDED,
          orderType: OrderType.DESC_OR_GREATER,
          uriType: UriType.EXTERNAL,
          ignoreCase: true,

     );
_musicList.forEach((element)async {
  var media = await _audioQuery.queryArtwork(element.id, ArtworkType.AUDIO);
  if(media == null){
      _musicList.removeAt(element.id); 
  }
});
notifyListeners();
}

E/MediaMetadataRetrieverJNI(21416): How can I block the warning?