![]() Registered Member ![]()
|
EDIT: I aded the script that I forgot to attach (remove the .txt extension before running)
Amarok uses the md5 hash of the artist and album concatenated to come up with the cover art file name. The script guesses the artist and album from the folder structure, so any time the actual artist or album tags are different from the folder names, the script fails. This can happen when there's weird characters like question marks and slashes in the tags. Also there's a few cases where the calculated md5 hash differs from the one amarok uses (removing and re-adding the cover art in amarok fixes this). I wrote a python version (attached) of Thundercloud's script that tells you which files failed and fixes a few other corner cases, but it will still fail on funny file names. It also needs the python dcop libraries. Instructions for ubuntu and more details are in the comments at the top. I tag and embed all my cover art now with picard + the cover art plugin, because I have high bitrate songs, and the 3-5% difference isn't a big deal for me, and because embedded cover art always transfers correctly. I highly recommend Picard 0.9.0 or above (the 0.7X versions are very buggy and clunky) if you collect albums rather than individual tracks. If you don't want to embed your cover art, you would have to modify one of our scripts to read the id3 tags directly. eyed3 was reasonably easy to use and has a python library.
Last edited by congyiwu on Sun Jan 20, 2008 2:18 am, edited 1 time in total.
|
![]() Registered Member ![]()
|
I already assumed a md5sum issue.
You wrote a python script and made an attachement? Did I miss something, or is here a special attachement section? However, thank you very much for yout suggestions and your support. Sincerly, Georg (Excuse my lousy english.) |
![]() Registered Member ![]()
|
Oh joy, and to confuse the issue further, behold this, it's the updated version of the script I posted before. It's been modified to work with the Cowon D2, but adapting back to the Z5 should be simplicity itself as they use almost the same things.
I also managed to _almost_ solve the "Cannot find cover" error by putting in a contingency method, which is to run a check past the amarok database. Again, it still requires the same file structure as before, but it replaces anything dodgy (like whitespace, apostrophes, _'s, etc) with a wildcard, so it has a much higher success rate than before. The only band which my script cannot find nowadays is Motörhead, and that's because the ö translates to "oe", so no error is flagged. Nevertheless, give it a whirl, it should hopefully be a lot better than my previous script. Thundercloud ps: You need _both_ of these scripts, and placed in the same directory. I find by using a remote ruby script rather than inlining it in bash, you solve quite a few problems with apostrophes and speech marks. And also, remember to remove the .txt extension before running these. |
![]() Registered Member ![]()
|
congyiwu,
unfortunately your script isn't running here. What do I need else than python-dcop? When I type
Thundercloud, there's a "mistake" within your script. There, ruby-md5 is located in /home/thundercloud/scripts. The script is is doing fine, but my problems remain the same. The script doesn't like ()'. That's bad because of my classic files
Perhaps the album titles shouldn't be too long? The script works with none of my classic files.
Last edited by Bendemann on Sun Jan 20, 2008 8:08 pm, edited 1 time in total.
|
![]() Registered Member ![]()
|
hashlib is new in python 2.5. My previous two distros, Ubuntu and Archlinux, used 2.5 as default. In Debian sid, I get tat error too now because the default python is still 2.4.
You can install python 2.5 and change the line at the top from #!/usr/bin/env python to /usr/bin/python2.5. If you know python, it would only take a few lines to change it to use the old md5 modules. |
![]() Registered Member ![]()
|
Bad, I use Etch at home. Thanks anyway.
BTW, I'm a total rookie according to writing scripts. But that's okay. ![]() |
Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]