CopyCover (amaroK Script)

Amarok 1.x Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

2
Become a Fan
5.0

Description:
Copy the cover of current playing track to the song's dir. Does not overwrite
existing images in this folder. The filenames can be configured with the
"Configure" dialog. By default, it's the album's name, with spaces replaced
by underscores.

An "offline" version is also included. If you have amaroK >= 1.2.3,
launch it and run the script on the command line. It will find all the downloaded covers and copy them in the right directory, just as the amarok plugin would have done. It also creates the desktop files.
Make sure you first run the script with the "-d" option (debug mode), in which
the actions will only be printed, not commited. A --help option is available.
AmaroK >= 1.2.3 and python >= 2.3 are required for this offline version.

The copycover-offline.py and addcoverdirs.sh scripts are NOT meant to be run through Amarok's script manager.
Last changelog:

ChangeLog:
Version: 1.9 Date: 2007/10/21
- fix queries when the database is in MySQL
- tell the session manager not to restart the script on login

Version: 1.8 Date: 2007/02/17
- fix the copycover-offline.py script to use the new device path feature of
Amarok. Thanks to all those who sent me a patch.

Version: 1.7 Date: 2006/10/19
- fixes for Amarok 1.4
- progress bar on the offline version
- use large images when available

Version: 1.6 Date: 2005/05/31
- bugfixes for the "remove covers" option
Thanks a lot to Gleb Litvjak and KNT for that.
- write debuginfo to ~/.xsession-errors by default


Ratings & Comments

143 Comments

garthps

Is there any news about this? Because I am rely interested. I have also email the author to aske him if he plan this..

garthps

in fact! I have done a clone of this for amarok 2 and it is here : http://www.kde-apps.org/content/show.php?content=113293

hachel

I have a gnome-desktop and I can't get it to work. I had to install pyqt3 otherwise it wouldn't start. Is there anything I have to install in order to use the offline-script? It just does this: Quote:

$ python copycover-offline.py -c cover.jpg copycover-offline.py:17: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 Done.
and there is a rotating little bar for a couple of seconds until it says "done", but nothing has happened, cover-wise. any help?

hachel

ok, if I use -v i get all the "processing artist xxx"-stuff, but that's it, changing the script like j4n said doesn't work either, same as before.

tecuya

This script does not work with amarok's Dynamic Collection feature. The following change (removing the devices table from the query) solves the issue for dynamic collection devices: Quote:

--- copycover/copycover-offline.py 2007-10-21 07:04:22.000000000 -0700 +++ copycover_mine/copycover-offline.py 2009-01-09 15:52:05.000000000 -0800 @@ -116,8 +116,9 @@ inc = inc + 1 if inc >= len(progress): inc = 0 - dcop_albums = commands.getoutput('''dcop amarok collection query "SELECT DISTINCT album.name, CONCAT(devices.lastmountpoint,'/',tags.dir) FROM tags, album, devices ''' \ - +'''WHERE tags.album = album.id AND tags.deviceid = devices.id AND album.name != '' AND tags.artist = %s"''' % artist_tuple[0]) + + dcop_albums = commands.getoutput('''dcop amarok collection query "SELECT DISTINCT album.name, tags.dir FROM tags, album ''' \ + +'''WHERE tags.album = album.id AND album.name != '' AND tags.artist = %s"''' % artist_tuple[0]) if not dcop_albums: continue

rakekniven

Please port the script for Amarok 2 Thank you

arealityfarbetween

Any advance on this? I would be very interested in this as i just did a distro upgrade and was looking forward to amarok 2-plays nice but copycover is essential to me!

mahen

Yep, I would also definitely be interested in an Amarok 2 port of this essential script.

gentiL

Thanks for the script. The part integrated with Amarok works great. My problem is with the offline version. It does something and I have tried with both -d and -v to see but it does not copy the files over to the destination. It just says processing artists... and their names. I have python 2.5.2 and Amarok 1.4.10. I also tried adding -c folder.jpg Am I doing something wrong? Thanks!

j4n

No, I had the same issue. After some twiddling I found the problem: the script uses the "CONCAT" function, which sqlite does not provide- maybe the author uses mysql? Here is a patch (replaces CONCAT (foo,bar)' with 'foo || bar'). Copy to file bar.patch and apply with patch -p0 bar.patch. paste below sucks, no code format possible here, so grab it here: http://pastebin.com/f5e7bcc5f Quote:

--- copycover-offline.py.org 2008-12-29 21:50:41.000000000 -0500 +++ copycover-offline.py 2008-12-29 22:01:40.000000000 -0500 @@ -116,7 +116,7 @@ for artist_tuple in artists: inc = inc + 1 if inc >= len(progress): inc = 0 - dcop_albums = commands.getoutput('''dcop amarok collection query "SELECT DISTINCT album.name, CONCAT(devices.lastmountpoint,'/',tags.dir) FROM tags, album, devices ''' \ + dcop_albums = commands.getoutput('''dcop amarok collection query "SELECT DISTINCT album.name, devices.lastmountpoint || '/' || tags.dir FROM tags, album, devices ''' \ +'''WHERE tags.album = album.id AND tags.deviceid = devices.id AND album.name != '' AND tags.artist = %s"''' % artist_tuple[0]) if not dcop_albums:

bony

Thank you for that nice script. Worked quite fine. I used the offline version for copying the files and renaming them to "Folder.jpg". PROBLEM: Some files actually are png-files and now are named with the wrong file type causing problems with my mp3 player. "Bug" or bad usage? Christoph

crumley

Several versions of the copycover-offline script didn't working for me - including checkob's above. I first tried sqlite, and now I am using mysql. After it didn't work with mysql, I decided to play muck around with the SQl a bit, even though I SQl was new to me. What I found was that the dcops_album = line was failing for me due to the fact my devices table was empty: mysql> SELECT * FROM devices; Empty set (0.00 sec) So I removed the references to devices in that line and fixed later spots so that they didn't depend on devices. Obviously that isn't the best way to fix things, but it worked for me. Does anyone have any better suggestions?

downdiagonal

That is where the script is having problems for me also. Would you mind sharing the changes you made?

crumley

Sure, you can have my version. I put it at: http://sites.google.com/site/stuff009/files/copycover-offline.py

downdiagonal

Thank you very much for sharing that. It worked perfectly!

ac4000

You rock. That script (especially with the update) was massively helpful. Thanks.

Bake

Hi, I use Ubuntu 8.04 and when I run the script in Amarok 1.4.9 there is this error: sh: kdialog: not found Traceback (most recent call last): File "/home/bake/.kde/share/apps/amarok/scripts/copycover.py", line 27, in <module> from qt import * ImportError: No module named qt I installed pyqt4. What can I do? Sorry if this a very stupid question but I'm a Linux newbie.

skulled

sudo apt-get install python-qt3

checkob

hi, I've developed an bug fix for the 'concat' problem in the offline-copycover script. the fixed script should now work for any database backed cause the string concatenation is made in python now, and no more in the database language. here is it, just replace the old copycover-offline.py with that one: http://attachr.com/private/d55ec021e8df30cbe0f922821554d57b

checkob

a guy from irc ( Ramblurr ) was that nice to host the script at an permanant place here it is: http://binaryelysium.com/code/copycover-offline.txt thanks again

TommyHLW

At first: I love this script!!!!! Is it possible to give the folders a non-absolut path for the foldericon? something like "/cover.png", insteat of "/media/hda3/music/artist/album/cover.png" I think it's not really pretty, if i want to use the same harddrive on my other pc and they are only folders without any icons, because the absolut path is a different on the second pc.

v6lur

To show "Cover.png" from current directory as icon: Icon=./Cover.png To show "Artist - Album.png" from parent-directory's subdirectory named "Covers": Icon=./../Covers/Artist - Album.png

stillingen

I have Amarok 1.4.9.1 (Ubuntu Hardy) running Sqlite. I've done the modifications to copy-offline.py but the covers are not copied. Are there other modifications needed to my version of Amarok?

Pling
0 Affiliates
Details
license
version 1.9
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 3

Other Amarok 1.x Scripts:

Gnome Play Video in Totem
mwheatland
last update date: 19 years ago

Score 5.0

editLyrics-gnome
ZeeD
last update date: 19 years ago

Score 5.0

amarok Alarm
aroth
last update date: 16 years ago

Score 5.0

amaroK Web Collection V xmms
pti-jean
last update date: 16 years ago

Score 5.0

SongLogger
lucatnt
last update date: 17 years ago

Score 5.0

amaroK Web Collection
pti-jean
last update date: 16 years ago

Score 5.0



System Tags