View Full Version : iTunes Update plugin v0.3

Craig, James (IT)
2004-11-10, 07:04
Thanks Jesse,
I don't have a unix box so I must admit I've never actually tested this
I had not considered this situation very thoroughly it seems...

Would you mind sending me an example file path & name for the same mp3
from iTunes (as iTunes sees it eg from the 'get info' page) and
SlimServer so I can try and fix this in the plugin?
Flipping the slashes is obviously easy - I'm not so sure about ignoring
the share name generically...


-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Jesse David
Sent: 10 November 2004 13:37
To: discuss (AT) lists (DOT) slimdevices.com
Subject: [slim] iTunes Update plugin v0.3

I'm not sure if this problem is unique to me, but I thought I'd share it
in case others are having similar issues or there needs to be some
changes made to the perl code...

I'm running my SlimServer on Linux, with iTunes running on Windows. My
entire library is on the Linux box, shared via Samba, and I've even
managed to convince iTunes to store it's ITL and XML files on the Linux
box as well (saves me the step of having to export them for SlimServer's

I'm running the latest version of the iTunes Plugin, and it's writing
the iTunes_Hist.txt file in the playlists directory, as it should. The
problem, however, is that when I run the iTunesUpdateWin.pl file and
point is at the iTunes_Hist.txt file on the server, it fails to find any
tracks to update, as there seems to be a path syntax discrepancy between
platforms (ie, Linux uses forward-slashes '/' and Windows uses
backslashes '\', for one thing), and it also seems to expect the server
name to form part of the output.

My quick-and-dirty hack to the iTunesUpdateWin.pl script was to add the
following two lines around line 48:

$location =~ s/\//\\/g;
$location =~ s/\\var\\/\\Frodo\\var\\/;

The first line replaces all forward-slashes with backslashes, and the
second adds my Linux server's name (Frodo) to the front of the path.

Again, this seems to have fixed it for me, but I share this solution in
case others may be having the same issues, and/or to find out if there
may be another/different/better way to handle this...

>>> James.Craig (AT) morganstanley (DOT) com 11/09/04 04:28:31 >>>
I should have said, shouldn't I?
No there isn't a home page as such - here's a snippet of the readme
that comes in the .zip archive;

iTunes Update is a SlimServer plug-in to update your iTunes database
with Slimserver client listening data, user ratings and playlists.


- When a track is determined to have been 'played', the iTunes
and last played fields are updated.

This is decided by 3 variables - minimum listen time (default 5s),
percentage listen time (default 50%) and maximum listen time (default
minutes). These settings can be modified in the iTunesUpdate.pm code.
For some reason (buffering perhaps) it's very unlikely that a full
of time is ever registered,
so don't set the % too high (This is particularly noticable on very
short tracks).

- iTunes rating from the client.

When on the 'now playing' screen the keys 1-5 and 0 can be used to
provide a rating for the track currently playing (0 being no stars in
iTunes). When the current track changes the rating will be written to
iTunes (even if it wasn't listened to long enough to qualify as a
'play'). Tracks can be re-rated as many times as you like before
written to iTunes.

- write SlimServer client playlists to iTunes

When on the 'now playing' screen holding down the play key will write
the current client playlist to iTunes.
It will be named the same as the client and appended with the current
date and time.
This can take a while so be careful not to activate this multiple

- Windows is the only currently supported iTunes platform.
(appleScript commands for Mac are printed to the log but not
executed as they've never been tested)

- There are two modes of operation, which can be changed from
(Server Settings - Plugins)
1. Direct update to iTunes (default configuration on Windows/Mac
Slimserver must be running on the same host as iTunes is
(iTunes does not need to be running before SLimserver -
it will be started when necessary)
Updates are performed direct to iTunes in real-time.

2. Indirect update to iTunes (any Slimserver platform, default
on unix)
iTunesUpdate logs play history and ratings to a file in
the playlist directory (default: iTunesUpdate_hist).
The standalone program iTunesUpdateWin.pl can process
this file and apply the updates.
(iTunesUpdateWin.pl requires perl library Win32::OLE and
must be run on the Windows iTunes host)
Note: Saving of playlists is not available in this mode
of operation.

- The plugin will NOT work in 'direct update' mode if SlimServer is
running as a service.
(Even if it's running as the user with access to iTunes.)
You need to run SlimServer as the iTunes user by starting
slim.exe/slimserver.exe or the slimserver.pl script.

- You need to be running a version of iTunes which supports the OLE
interface - (4.5 or later.)

- It can take a while to start iTunes the first time it's accessed.
Saving long playlists to iTunes can take a while. These actions may
cause a pause in playback.

- Because SlimServer caches the MP3 tags, iTunes will not be updated
key tags (artist,album, track name) have been changed in iTunes and
SlimServer cache hasn't been updated.


-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of ron
Sent: 08 November 2004 21:47
To: Slim Devices Discussion
Subject: [slim] iTunes Update plugin v0.3

is there a home page for this plugin, which details what it does aso ?

Craig, James (IT) wrote:

>I've just released a new version of my iTunesUpdate plugin, after
>finding a very stupid bug in it.
>There are a couple of other changes as well.
>v0.3 - Ignore 'empty client' commands
> - fix blank space regexp and code
> - Remove many log messages
> - Standardise remaining log messages
> - Only attempt to log play of files (not streams)
> - Fixed creation of settings on first run
> - Add 'show messages' to plugin settings
>You can download it at
>NOTICE: If received in error, please destroy and notify sender.
does not waive confidentiality or privilege, and use is prohibited.