View Full Version : iTunes update plugin 0.6 and iTunes4.7.1.30notplayingnice..

Richard Grant
2005-01-20, 12:26
> Thanks Richard.
> I haven't actually done much testing with the latest version of
> iTunes...
> I'll put this change in the next release.

umm.. looks like SP2 and new security fixes for Windows XP might have messed
up the RPC layer. I just finished a patch at the end of this email, because
you don't manage the OLE environment *nicely* in your script, and that could
lead to memory leaks and crashes, but then my patch didn't work because..
GetActiveObject does *nothing* in your script! But you are not doing
anything wrong. I think that RPC->COM+->OLE->Win32::OLE has been killed from
the bottom up by RPC localhost permission changes in recent security

I didn't even ask to have my patch installed :-( I just happened to select
the recommended setting of autoupdate at 3am without reading the fine print.
Great. I'm off to ActiveState's OLE list for a bit.. there's some grumbling
over there about GetActiveObject.

Here's the patch I was going to propose, and it is still somewhat useful in
that it closes the memory leak left open by the script performing a
Win32::OLE->new without closing the application in the object d'tor. The
other upside is that you can schedule this and it should work very nicely.
The downside is that if iTunes is already running, the patch will force it
to close because GetActiveObject silently fails.

$iTunesHandle = new Win32::OLE("iTunes.Application", sub {$_[0]->Quit;})
or $failure = 1;


> -----Original Message-----
> From: discuss-bounces (AT) lists (DOT) slimdevices.com
> [mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Richard
> Grant
> Sent: 20 January 2005 13:58
> To: Slim Devices Discussion
> Subject: [slim] iTunes update plugin 0.6 and iTunes
> > Thanks Richard.
> > I've not seen this one myself.
> > What would the date have been that failed?
> Found track in iTunes
> Marking as played in iTunes
> Incremented playedCount: was 3
> 20050120062631 vs 20050119062631
> update-orig: 06:26:31 20-Jan-2005
> update-prop: 20-01-2005 06:26:31
> Modified playedDate
> > The reason I translated the month into a string was because I wasn't
> > sure what would happen with US vs UK date formats...
> > It's all a bit of a guess!
> So, this is a variant data type that would be converted from a native
> perl
> time. mmm.. ok, I tried the following and it worked. So that should
> clear up
> any problems with date format.
> $status = $trackHandle->{playedDate} = "$year-$month-$day
> $hr:$min:$sec";
> I'm a little curious about why the problem exists to begin with. Perhaps
> a
> recent upgrade has changed COleDateTime or perhaps version
> iTunes
> has something new in IITTrack. Oh well. No bother, it works for me now.
> > What localisation does your machine have set?
> My dates/currency are set for Greek/European with English Windows and
> US/Greek Keyboards..
> Richard