PDA

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



Craig, James (IT)
2005-01-21, 02:23
Ha I actually looked at my code and I understand now!
It would still kill iTunes once per session if the GetOpenObject is not
working as you say?
Hmmmm.


James

-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Craig, James
(IT)
Sent: 21 January 2005 09:03
To: Slim Devices Discussion
Subject: [slim] iTunes update plugin 0.6 and
iTunes4.7.1.30notplayingnice..

Richard,
It seems you know a lot more about this than I actually do!

However, I'm not keen on changing the behaviour if iTunes is already
open.
The "openiTunes" function gets called very often in the plugin and this
would therefore keep opening and closing iTunes!
I personally have iTunes running all the time as my iPod is plugged into
the server.

Is there a better way of doing this?
I could do it just in the stand alone update script (is that what you
were proposing?)

BTW I am resisting SP2 on my PC so I guess that's why I've not seen any
problems!

James

-----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 19:26
To: Slim Devices Discussion
Subject: [slim] iTunes update plugin 0.6 and
iTunes4.7.1.30notplayingnice..

> 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
patches.

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;

Richard

> -----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
> 4.7.1.30notplayingnice..
>
> > 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 4.7.1.30
> 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
>
>