Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    17

    TrackStat / iTunesUpdate and AppleScript-Glue

    Hi,

    I've been desperately trying to get either iTunesUpdate or TrackStat/CustomScan to work for exporting rating stats to iTunes. It does not work on Mac OS X (Snow Leopard). I've posted this issue before back in March. In the meantime there have been many error reports from other users on this forum. To sum up:

    - iTunesUpdate as well as the TrackStatiTunesUpdate.pl script from TrackStat rely on the Mac::AppleScript::Glue module. This module translates Perl code to AppleScript.
    - The execution of both results in an error -1753 (within the server log for iTunesUpdate, and within Terminal for TrackStat).
    - It seems the problem is with the Glue package. The latest version 0.03 dates back to the year 2002. There are no updates and the homepage of the developer does not exist anymore (see http://search.cpan.org/~jlabovitz/Ma...e-0.03/Glue.pm).
    - The package installed without errors on my system via CPAN. When trying to reinstall Mac::AppleScript::Glue or Mac::AppleScript::Glue::Application or Mac::AppleScript::Glue::Object or Mac::AppleScript, CPAN states that all packages are installed and that there are no updates available.
    - I'm running Mac OS X 10.5 with Squeezebox Server 7.5.1 and iTunes 10.

    First, I'd like to know if there is anyone with this configuration for whom iTunesUpdate or TrackStat's iTunes Export is actually working? If so we could try to figure out what they have done differently.

    I can do some AppleScript'ing, however, unfortunately I have never touched Perl so far. It would take months for me to translate the Perl script to AppleScript. Is there someone who has translated the Perl scripts into AppleScript? This really would be an option as the history files from iTunesUpdate or TrackStat/CustomScan get written properly. I know James is on a Windows machine, but Erland has access to a Mac. Erland, are you running Squeezebox Server on Linux or on Mac? Maybe we could try to translate your script to AppleScript together?

    IMHO, it would really be a big win to get rating sync working between iTunes and Squeezebox Server.

    Thanks,
    Thomas

  2. #2
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,039
    Quote Originally Posted by -tm- View Post
    I can do some AppleScript'ing, however, unfortunately I have never touched Perl so far. It would take months for me to translate the Perl script to AppleScript. Is there someone who has translated the Perl scripts into AppleScript? This really would be an option as the history files from iTunesUpdate or TrackStat/CustomScan get written properly. I know James is on a Windows machine, but Erland has access to a Mac. Erland, are you running Squeezebox Server on Linux or on Mac? Maybe we could try to translate your script to AppleScript together?
    I'm running SBS on Linux.

    I haven't done any AppleScript development myself, so I'm afraid I can't help much on that part. However, if you provide a working AppleScript that reads the history file and imports it into iTunes, I will be happy to include it with the plugin unless you like to publish and support it yourself.

    It's mostly James who have done the *iTunesUpdate.pl scripts, I've just done some small adjustments to make it work with the full export supported by TrackStat to generate a file with all ratings in the SBS database.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    17
    Hi Erland,

    I nearly got the AppleScript ready... I'm currently debugging. A couple of things:

    1. The routine is all about getting TrackStat info into iTunes. What about CustomScan's iTunes import? I hope this does not rely on the Perl-2-AppleScript Glue module as well? (I cannot test this myself for now as all of my ratings are still in TrackStat.)

    2. In the TrackStat_iTunes_Complete.txt file, the 2nd and 3rd entries are always empty for me. Judging from your Perl code in TrackStatiTunesUpdate.pl they should contain artist and album information. Actually I do not need them, however, I want to make sure this is how it is intended from you.

    3. I have some problems with special characters in your TrackStat_iTunes_Complete.txt file. They do not get written out correctly. E.g. "GamÚi" will end as "Game├┼i" and "M÷stl" will end as "Mo├Óstl". Therefore I cannot match the location between iTunes and TrackStat. Is this a known problem with TrackStat? If so, could you fix this?

    4. In TrackStat_iTunes_Complete.txt you are either writing the rating or the playcount + "last played". Would not it be better to include "last played" for the rating as well? Consider the following situation: I have rated a track with TrackStat. I have rated the same track later on my iPod. Having the "last played" data I could decide which rating is the newer one.

    5. Is it possible to include skip counts and "last skipped" as well? iTunesUpdate did this on my old Windows machine.

    Thanks for taking the time!

  4. #4
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,039
    Quote Originally Posted by -tm- View Post
    1. The routine is all about getting TrackStat info into iTunes. What about CustomScan's iTunes import? I hope this does not rely on the Perl-2-AppleScript Glue module as well? (I cannot test this myself for now as all of my ratings are still in TrackStat.)
    The import/export shown in Custom Scan is provided through TrackStat, if I remember correctly the incremental export (TrackStat_iTunes_Hist.txt) file is missing the last (added) column compared to the full export (TrackStat_iTunes_Complete.txt) file. They both use the TrackStatiTunesUpdate.pl script.

    I don't think the "added" column is used in TrackStatiTunesUpdate.pl because I think iTunes no longer supports to set that from outside.

    Quote Originally Posted by -tm- View Post
    2. In the TrackStat_iTunes_Complete.txt file, the 2nd and 3rd entries are always empty for me. Judging from your Perl code in TrackStatiTunesUpdate.pl they should contain artist and album information. Actually I do not need them, however, I want to make sure this is how it is intended from you.
    The code is written so it doesn't write anything in these columns, I'm not sure exactly why but it's how it has always worked.

    Quote Originally Posted by -tm- View Post
    3. I have some problems with special characters in your TrackStat_iTunes_Complete.txt file. They do not get written out correctly. E.g. "GamÚi" will end as "Game├┼i" and "M÷stl" will end as "Mo├Óstl". Therefore I cannot match the location between iTunes and TrackStat. Is this a known problem with TrackStat? If so, could you fix this?
    It is not a known problem, I know it has worked previously for Swedish characters ┼─Í but I haven't used it for a while. Unfortunately, I don't have the time to try to fix it myself in the near future, but patches are always welcome. Is the problem the same in both the incremental and full export ? Is it the same independent of language setting in SBS ?

    You probably need to call one of the Slim::Utils::Unicode::* methods to do some conversion before the "print" directive to make it work.

    The problem with these characters set issues is that when you fix it for one user it usually breaks for someomne else because they have different language settings on computer or in SBS.

    Quote Originally Posted by -tm- View Post
    4. In TrackStat_iTunes_Complete.txt you are either writing the rating or the playcount + "last played". Would not it be better to include "last played" for the rating as well? Consider the following situation: I have rated a track with TrackStat. I have rated the same track later on my iPod. Having the "last played" data I could decide which rating is the newer one.
    It should write last played for all tracks that has been played in the *_Complete.txt file. The only records that doesn't get a last played value are those that never have been played.

    In the *_Hist.txt file last played values are only written when a track as actually been played. I suppose I could add it to the "rated" entries but I'm not sure it makes sense since it's perfectly ok to only rate a track without playing it in the TrackStat interface.

    Quote Originally Posted by -tm- View Post
    5. Is it possible to include skip counts and "last skipped" as well? iTunesUpdate did this on my old Windows machine.
    There isn't any skip counts in the SBS database.
    iTunes Update only have the incremental file and if I remember correctly it doesn't include a skip count, it only includes a skip directive telling the iTunesUpdate.pl script to increase the skip count in iTunes with 1. It would be possible to do the same in the TrackStat *_Hist.txt file but not in the *_Complete.txt file since there isn't any counts in the database. Unfortunately, I don't have any time to do anything about this myself in the near future but patches are always welcome.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets

  5. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    17
    Thanks for your answer and your comments.

    I've finished the project. I'll post the script in a separate script. If you like, you can include it with your plugin. I've tried to make it as user friendly as possibly.

    To add to my comments:
    1. CustomScan's iTunes import routine is working without any problems.
    3. The problem with special chars only occurred for some files, not for all with special chars in their name. My incremental history file is too short yet to judge if the problem is with a complete export only. However, I've included a routine in my script which will display these kind of problems to the user.
    4. I've found the "last played" info for rated tracks.

    Thanks for your help.

  6. #6
    Member
    Join Date
    Mar 2009
    Location
    Germany
    Posts
    81
    I now have the same problems with the installing of GLUE under OSX 10.6.
    How is the solution for a working itunesUpdate in Snow Leopard?
    Thank you!

  7. #7
    Junior Member
    Join Date
    Mar 2010
    Posts
    17
    Hi, the solution is nearly the same as before when using TrackStat & CustomScan. The only difference is to use the App attached to the thread http://forums.slimdevices.com/showthread.php?t=83307 instead of using the TrackStatiTunesUpdate.pl Perl script for exporting ratings and play counts to iTunes. Hope that helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •