On 9/15/05, Kevin Kuphal <[EMAIL PROTECTED]> wrote: > Pete Clarke wrote: > > >Hi all, > > > >Does Myth support automatic downloading of album artwork for entries in > >MythMusic or do I have to provide the artwork seperately? > >I know that it can/will retrieve track listings etc. for ripped CD's, but > >does it also grab the cover art? > >I have looked around but can't find an answer. > >
I use this perl script and patch to automatically grab the cover art from amazon.co.uk, post CD rip. * Install the script somewhere useful e.g.: /usr/local/share/mythtv/mythmusic/scripts/amazon.pl * Apply the patch to mythplugins * Set your post rip script to the following: /usr/local/share/mythtv/mythmusic/scripts/amazon.pl %d "%a" "%t" The patch will convert the %d, %a and %t to music dir, artist name and title, then seach amazon.co.uk to find the cover art. Change the perl script to use an amazon site more relevant to your locale. Probably worth testing standalone first though, to check it works for you! Paul
amazon.pl
Description: application/aa-dhelper
Index: mythplugins/mythmusic/mythmusic/cdrip.cpp
===================================================================
--- mythplugins/mythmusic/mythmusic/cdrip.cpp (revision 6845)
+++ mythplugins/mythmusic/mythmusic/cdrip.cpp (working copy)
@@ -671,6 +671,10 @@
QString musicdir = gContext->GetSetting("MusicLocation");
musicdir = QDir::cleanDirPath(musicdir);
+ QString cddir;
+ QString cdartist;
+ QString cdtitle;
+
if (!musicdir.endsWith("/"))
musicdir += "/";
@@ -722,6 +726,13 @@
qApp->processEvents();
handleFileTokens(outfile, track);
+ if (cddir.isEmpty())
+ {
+ cddir = outfile.remove(QRegExp("/[^/]*$")); // Should remove last "/{anything}" from the filename
+ cdartist = track->FormatArtist();
+ cdtitle = track->FormatTitle();
+ cout << "CD Directory : " << cddir << endl;
+ }
if (encodequal < 3)
{
@@ -770,6 +781,18 @@
if (!PostRipCDScript.isEmpty())
{
+ // Need to do directory substitution
+ if(PostRipCDScript .contains("%d"))
+ PostRipCDScript = PostRipCDScript.replace( QRegExp("%d"), cddir );
+
+ // Need to do Artist substitution?
+ if(PostRipCDScript .contains("%a"))
+ PostRipCDScript = PostRipCDScript.replace( QRegExp("%a"), cdartist );
+
+ // Need to do Title substitution?
+ if(PostRipCDScript .contains("%t"))
+ PostRipCDScript = PostRipCDScript.replace( QRegExp("%t"), cdtitle );
+
VERBOSE(VB_ALL, QString("PostCDRipScript: %1").arg(PostRipCDScript));
pid_t child = fork();
if (child < 0)
_______________________________________________ mythtv-users mailing list [email protected] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
