PDA

View Full Version : Problem with Custom Scan / iTunes Export



rlem
2014-03-11, 09:22
Hi Erland,

Iíve got a problem that has been bugging me for quite a time now. The Custom Scan integration with iTunes is working perfectly in combination with the iTunesUpdate.pl script: ratings/playcounts are exported from and imported to iTunes, but not for songs/albums that have special characters in them.

If I open the Trackstat_iTunes_Hist.txt then I immediately see whatís causing it: the special characters are garbled, so that the script cannot match them to the paths that iTunes is using.
If I convert the file to UTF-8, the characters become readable again, so I think that solves it.
But, I cannot save the file because Trackstat is using it. So could it be that there is a bug in Trackstat?

Funny thing on the side: the iTunes Import works like a charm: if I change a rating in iTunes, it gets picked up by Trackstat, no problem.

Please see my screenshots!
https://www.dropbox.com/sh/8ofvohl62gzzh82/NfUqttWH9c

Thanks for helping me out,
Randy

===

This is my set-up:
(1) LMS 7.8 Nightly on Ubuntu 12.04 server (UTF-8 encoding)
(2) iTunes Library on Windows 8 PC

erland
2014-03-11, 21:33
If I convert the file to UTF-8, the characters become readable again, so I think that solves it.

Is the music mounted as a network drive on the iTunes machine ?
My personal experience is that it's best to avoid non us ascii characters in file names and just have them in the tags, this solves a lot of problems when you are using the files on multiple operating systems with different default character encoding.



But, I cannot save the file because Trackstat is using it. So could it be that there is a bug in Trackstat?

Strange, TrackStat is supposed to close the file after writing to it. Does it help if you temporarily shutdown LMS when you change the file ?
If you try to change it from the iTunes machine, could it be that you have mounted the drive as read only ?

rlem
2014-03-14, 13:54
Hi Erland,

I followed your advice and (grrr... reluctantly) removed all the special characters from the filenames; so in the future I won't be able to let iTunes do the organizing.
Guess that's the trade-off in working with Linux and Windows...

Next, I cleared all Trackstat info & tried a new iTunes Import, and I see that most but not all of my ratings/statistics are imported (argh!).
This is the error in scanner.log; does that ring a bell?



[14-03-14 20:57:01.3313] Slim::Utils::Misc::msg (1304) Warning: [20:57:01.3310] Use of uninitialized value $added in concatenation (.) or string at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/Storage.pm line 1166, <ITUNESLIBRARY> chunk 19875.

[14-03-14 20:57:01.3319] Slim::Schema::Storage::throw_exception (122) Error: DBI Exception: DBD::SQLite::db prepare failed: near ",": syntax error [for Statement "INSERT INTO track_statistics (url,urlmd5,playCount,added,lastPlayed) values (?,'f3101bf39d568d77fc8c2fbb7249b8a3', 1,,1378845500)"]
[14-03-14 20:57:01.3322] Slim::Schema::Storage::throw_exception (122) Backtrace:

frame 0: Slim::Utils::Log::logBacktrace (/usr/share/perl5/Slim/Schema/Storage.pm line 122)
frame 1: Slim::Schema::Storage::throw_exception (/usr/share/squeezeboxserver/CPAN/DBIx/Class/Storage/DBI.pm line 1006)
frame 2: DBIx::Class::Storage::DBI::__ANON__ (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/Storage.pm line 1178)
frame 3: Plugins::TrackStat::Storage::mergeTrack (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/iTunes/Import.pm line 803)
frame 4: Plugins::TrackStat::iTunes::Import::sendTrackToSto rage (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/iTunes/Import.pm line 492)
frame 5: Plugins::TrackStat::iTunes::Import::handleTrack (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/iTunes/Import.pm line 627)
frame 6: Plugins::TrackStat::iTunes::Import::handleEndEleme nt (/usr/share/squeezeboxserver/CPAN/XML/Parser/Expat.pm line 617)
frame 7: XML::Parser::ExpatNB::parse_more (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/TrackStat/iTunes/Import.pm line 356)
frame 8: Plugins::TrackStat::iTunes::Import::scanFunction (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/CustomScan/Scanner.pm line 1904)
frame 9: (eval) (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/CustomScan/Scanner.pm line 1904)
frame 10: Plugins::CustomScan::Scanner::exitScanTrack (/usr/share/perl5/Slim/Utils/Scheduler.pm line 156)
frame 11: (eval) (/usr/share/perl5/Slim/Utils/Scheduler.pm line 156)
frame 12: Slim::Utils::Scheduler::run_tasks (/usr/sbin/squeezeboxserver line 678)
frame 13: main::idle (/usr/sbin/squeezeboxserver line 645)
frame 14: main::main (/usr/sbin/squeezeboxserver line 1158)


[14-03-14 20:57:01.3325] Plugins::CustomScan::Scanner::exitScanTrack (1906) CustomScan: Failed to call exitScanTrack on module Plugins::TrackStat::Plugin->itunesimport: Carp::Clan::__ANON__(): DBI Exception: DBD::SQLite::db prepare failed: near ",": syntax error [for Statement "INSERT INTO track_statistics (url,urlmd5,playCount,added,lastPlayed) values (?,'f3101bf39d568d77fc8c2fbb7249b8a3', 1,,1378845500)"] at /usr/share/perl5/Slim/Schema/Storage.pm line 126

rlem
2014-03-15, 03:08
Nevermind! I resolved it by setting the log level to Debug and there I could see where the scanning went wrong exactly.
Turned out to be a corrupt mp3 file. Back to happy listening! :-)