On Jan 5, 2005, at 7:04 PM, Chris Nandor wrote:

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Cutter Brown) wrote:

One of the biggest issues I'm having right now is querying the Library
by the database_id:

         my $track = $remote->obj(
                 tracks   => whose(database_id => equals => $args),
                 playlist => 1
         );

This actions seems to take forever (30+seconds). Is there a better way
to get the track from id?

The problem is that iTunes is just very slow at whose searches.

There may be another way, though I don't know how reliable it is, and it's
more of a pain. Instead of getting the database ID, get the unique ID:


   my $id = $sometrack->get->getdata;

Then:

   my $track = $remote->obj(
      track    => obj_form(formUniqueID, typeLongInteger, $id),
      playlist => 1
   );


hrm, this doesn't seem to work for me for example:

        my $track = $remote->prop('current_track')->get();
        my $uid = $track->get->getdata;
        print "uid: $uid\n";
                my $new_track = $remote->obj(
      track    => obj_form(formUniqueID, typeLongInteger, $uid,
      playlist => 1
        );
        my $name = $new_track->prop('name')->get();
        print "name: $name\n";

I would expect $name to be the same name as the current track, but
its turning out to be empty every time.  Am I doing something dumb?

Thanks,

Cutter

That's very fast, assuming a. you can get the unique IDs, and b. they are
reliably consistent for you. (This was somewhat documented in the Mac::Glue
POD, using iPhoto as an example, for a different problem.)


Good luck,

--
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/



Reply via email to