So I'm trying to use this getPlaylist function
|
async getPlaylist(opts: GetPlaylist.Options) { |
My function currently looks like this:
async function getAllProLinkTracks() {
let tracks = [];
if (!prolinkNetwork) {
console.warn('ProLink network is not connected');
return tracks;
}
const devices = Array.from(prolinkNetwork.deviceManager.devices.values());
for (const device of devices) {
if (device.type !== 1) {
continue;
}
const deviceTracks = await prolinkNetwork.db.getPlaylist({ deviceId: device.id, mediaSlot: MediaSlot.USB });
console.log('getPlaylist deviceTracks', device.id, deviceTracks);
if (deviceTracks) tracks.push(...deviceTracks);
}
console.log('PROLINK TRACKS getPlaylist', tracks);
return tracks;
}
I essentially iterate through all the devices and try to call the getPlaylist function.
But the result for deviceTracks of each device is always null... not sure is this normal? I have tracks and playlists on the USB.
Am i using the right approach?
So I'm trying to use this
getPlaylistfunctionprolink-connect/src/db/index.ts
Line 217 in eea03bc
My function currently looks like this:
I essentially iterate through all the devices and try to call the getPlaylist function.
But the result for deviceTracks of each device is always null... not sure is this normal? I have tracks and playlists on the USB.
Am i using the right approach?