Looking up cover art in database

Bill Moseley moseley at hank.org
Mon Mar 19 00:47:58 UTC 2007


On Mon, Mar 19, 2007 at 08:21:45AM +1100, Seb Ruiz wrote:
> On 19/03/07, Bill Moseley <moseley at hank.org> wrote:
> >$ perl -MDigest::MD5 -le 'print Digest::MD5::md5_hex(lc "Bob Marley & The 
> >WailersNatty Dread")'
> >bc9732fd602386a091c5f1231b1828fa
> 
> IIRC, it should be md5( artist + " - " + album );
> But i could be mistaken. Try with that.

Well, I don't know c++, but I don't see that " - " anywhere.

collectiondb.cpp has this:

    QCString key = md5sum( artist_, album );
    newAmazonReloadDate(asin, AmarokConfig::amazonLocale(), key);
    // Save Amazon product page URL as embedded string, for later retreival
    if ( !amazonUrl.isEmpty() )
        img.setText( "amazon-url", 0, amazonUrl );

    const bool b = img.save( largeCoverDir().filePath( key ), "PNG");

And md5sum:

QCString
CollectionDB::md5sum( const QString& artist, const QString& album, const QString& file )
{
    KMD5 context( artist.lower().local8Bit() + album.lower().local8Bit() + file.local8Bit() );
//     debug() << "MD5 SUM for " << artist << ", " << album << ": " << context.hexDigest() << endl;
    return context.hexDigest();
}

I don't think the .local8Bit() is a problem.  But I don't understand
what happens when calling with only two arguments.  Maybe I'm confused
about what is calling what there.


You can see why I was hoping that the md5 key was stored in the
database and related to the album.  Seems to be in the amazon table
but I don't see any relationships that would help.


Thanks,



-- 
Bill Moseley
moseley at hank.org




More information about the Amarok mailing list