0

I am calling this function MusicFiles.getAll. It returns Something get wrong with musicCursor. Instead, it should return an array of all the music tracks.

 MusicFiles.getAll({})
        .then(tracks => {
          console.log(tracks);
        })
        .catch(error => {
          console.log(error);
        });

The expected output is supposed to be something like this.

[
  {
    id : 1,
    title : "La danza del fuego",
    author : "Mago de Oz",
    album : "Finisterra",
    genre : "Folk",
    duration : 132132312321, // miliseconds
    cover : "file:///sdcard/0/123.png",
    blur : "file:///sdcard/0/123.png",
    path : "/sdcard/0/la-danza-del-fuego.mp3"
  }
]
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Omkar Kulkarni
  • 1,091
  • 10
  • 22

1 Answers1

1

In my case this was happening when no music on my device. I was running an emulator. I copied files using drag n' drop. Files were copied but not showing in device file manager. Restarted the device. Got the files.

sanister
  • 330
  • 6
  • 11