Skip to content

Trying to fetch all tracks from USB on CDJ #29

@jellohouse

Description

@jellohouse

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions