PDA

View Full Version : iTunes Update plugin v0.3



Craig, James (IT)
2004-11-13, 03:26
Attached is a new version of the iTunesUpdateWin.pl script (renamed to
..txt as I don't think I can send .pl files).
I have added the change for UNIX slash direction, and now only attemot
to match the Slimserver path at the end of the iTunes path -
any leading "share" name should be ignored.
(although I think this will only work if you share your music folder at
the root level)

Please let me know if it works any better.

James




-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of
kcheves (AT) sbcglobal (DOT) net
Sent: 12 November 2004 18:27
To: 'Slim Devices Discussion'
Subject: [slim] iTunes Update plugin v0.3

Jesse - Thanks for posting this. Oddly enough, I have the exact same
configuration (SMB share with music, iTunes on Windows). My Linux server
is
even named frodo! I've been wanting this functionality for some time,
and
am eager to try it out.

Thanks,

Kit

> -----Original Message-----
> From: Jesse David Hollington [mailto:jdh (AT) kenetic (DOT) com]
> Sent: Wednesday, November 10, 2004 5:37 AM
> 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 consumption).
>
> 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 file 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.
>
>
> Features:
> =========
>
> - When a track is determined to have been 'played', the iTunes
> playcount
> 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
> 15
> minutes). These settings can be modified in the iTunesUpdate.pm code.
> For some reason (buffering perhaps) it's very unlikely that a full
> 100%
> 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
> they're
> 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
> times!
>
>
>
> Notes
> =====
> - 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
> SlimServer
> (Server Settings - Plugins)
> 1. Direct update to iTunes (default configuration on Windows/Mac
> Slimserver):
> Slimserver must be running on the same host as iTunes is
> run
> (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
> if
> key tags (artist,album, track name) have been changed in iTunes and
> the
> SlimServer cache hasn't been updated.
>
>
> James
>
> -----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
>
> Hi,
> is there a home page for this plugin, which details what it does aso ?
> Greetings,
> Ron
>
>
> 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
> >
> >www.jamescraig.co.uk/SlimServer/iTunesUpdate.zip
> >
> >James
> >--------------------------------------------------------
> >
> >NOTICE: If received in error, please destroy and notify sender.
> Sender
> does not waive confidentiality or privilege, and use is prohibited.
> >
> >
> >