Bug 12767 - OSX iTunes Artwork importer spews error messages when missing artwork
: OSX iTunes Artwork importer spews error messages when missing artwork
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.3.4
: Macintosh MacOS X 10.5
: -- normal (vote)
: 8.0.0
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-09 22:52 UTC by Daniel Jackson
Modified: 2009-07-29 14:59 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Jackson 2009-07-09 22:52:15 UTC
Overview:
When running a full library scan (such as on a clean install), the scanner.log is filled with error messages.
Example error message:

[09-07-09 20:50:59.7971] Slim::Plugin::iTunes::Importer::Artwork::OSX::exportSingleArtwork (107) Error: Error from artwork script: Error getting artwork: iTunes got an error: Parameter error.

Steps to Reproduce:
1) Have an iTunes library with songs/albums without artwork.
2) Do a "Clear library and rescan everything" scan.

Actual Results:
During the "iTunes User-Added Artwork Import" phase, error messages are being generated, one for every item that doesn't have artwork. I'm not sure what is being scanned, the number is greater than the number of albums but far less than the number of songs.

Expected Results:
No error messages generated. It isn't an error for an item to not have artwork.

Platform:
Version: 7.3.4 - 27392 @ Thu Jul 9 03:01:26 PDT 2009
Operating system: Mac OS X 10.5.7 (9J61) - EN - utf8
Platform Architecture: ppc
Perl Version: 5.8.8 - darwin-thread-multi-2level
MySQL Version: 5.0.22-standard


Suggestions to fix this, and the code generating this error:

In the file server/Slim/Plugin/iTunes/Importer/Artwork/OSX.pm, the method exportSingleArtwork calls an AppleScript located in the Bin directory (server/Bin/darwin/itartwork.scpt), and handles two cases:
1) Success, where it returns the file (indicated by script output of "OK <path>")
2) Failure, where it logs the error and returns nothing (indicated by script output of anything else).

I suggest adding a third case, No artwork, where it doesn't log an error and returns nothing (indicated by script output of "No artwork found" or similar).

In the script, line 221 ("set theArtwork to artwork 1 of theTrack") causes the iTunes Parameter error if there is no artwork associated with the track. A simple if statement before line 221 can fix this:

if (count of artwork of theTrack) < 1 then
  return "No artwork found"
end if

I have made this change on my system, and was able to eliminate the spurious error messages.

PS: Visual inspection of server/Slim/Plugin/iTunes/Importer/Artwork/Win32.pm suggests that the same problem does not exist for Windows, since there is a check for ($artworks->Count > 0) before trying to access the artwork.
Comment 1 Andy Grundman 2009-07-29 14:59:32 UTC
Moving 7.4 bugs to 8.0.