collection2html

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

0
Become a Fan
5.0

Description:
Version 0.1.3

amaroK collection2html
License: GPL v2

This script will create a html page containing your mp3 collection ordered by Artist and Album. No customizations are available at this time with the execption of the ouput file selection at runtime.
Heavily based on playlist2html from André Kelpe (fs111 at web dot de).

Requeriments:
Python 2.3
KDE 3.x (for dialog window)

Known problems:

* If the album title is NULL then the script will skip it. This is a constraint due to an unsolved dcop bug wich causes null fields to be skipped on an sql query output.
* The author doesn't knows nothing about Python.

Author:
Marcelo Bovo
mdbovo at gmail dot com
Last changelog:

0.1 Initial release
0.1.1 Minor typo fixes
Converted album length to HH:MM:SS format.
0.1.2 Fixed issue with albums with the same name and compilations.
0.1.3 Fixed sql query error on some systems (thanks sputnik73!)


Ratings & Comments

11 Comments

sputnik73

To work with mySQL, line 103 must be replaced by: doc = os.popen('dcop amarok collection query \'select artist.name AS Artist, album.name AS Album,sum(length) AS Length,count(track) AS Tracknr,year.name AS Year from tags, album, artist, year where tags.album = album.id and tags.artist = artist.id and tags.year = year.id and album.name <> "" and tags.sampler = 0 group by tags.artist, tags.album, tags.year union select "Various Artists", album.name,sum(length),count(tags.track),year.name from tags, album, year where tags.album = album.id and tags.year = year.id and album.name <> "" and tags.sampler = 1 group by tags.album, tags. year\'').readlines() Reason: 1) Subquery must be named, but is obsolete anyway 2) "Name" fields must be named unique

gerardolm

[code]File "/home/gerardo/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 111, in _extractTracks value = doc.pop() IndexError: pop from empty list[/code] Am I supposed to do anything before running it? Thanks

jayenell

Same for me or does it only work with sqllite and not with mysql?

drnoone

jayenell: It should work with both mysql and sql-lite. All database querys are made through amarok dcop interface so wich database is on the backend is transparent to my script. gerardolm: It seems as if your music collection were empty (no records were returned from your query). Could you send me more information about the error?. Regards, Marcelo

gmhafiz

Same here. I'm using mySql This is the error message: Traceback (most recent call last): File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 25, in ? main() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 12, in main collect = Collection() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 73, in __init__ self._buildDoc() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 95, in _buildDoc self._extractTracks() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 111, in _extractTracks value = doc.pop() IndexError: pop from empty list Traceback (most recent call last): File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 25, in ? main() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 12, in main collect = Collection() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 73, in __init__ self._buildDoc() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 95, in _buildDoc self._extractTracks() File "/home/gmhafiz/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 111, in _extractTracks value = doc.pop() IndexError: pop from empty list

marcelpaulo

I have just converted my amarok database from SQLite to MySQL, and collection2html also fails with the same error backtrace as was previously shown.

mierdaman

I also have this problem. I paste the error log: Traceback (most recent call last): File "/home/javi/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 25, in <module> main() File "/home/javi/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 12, in main collect = Collection() File "/home/javi/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 73, in __init__ self._buildDoc() File "/home/javi/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 95, in _buildDoc self._extractTracks() File "/home/javi/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 111, in _extractTracks value = doc.pop() IndexError: pop from empty list

JohnNy64

Seems like the same problem that I ran into with PostgreSQL: Traceback (most recent call last): File "/home/JohnNy64/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 25, in <module> main() File "/home/JohnNy64/.kde/share/apps/amarok/scripts/collection2html/collection2html.py", line 12, in main collect = Collection() File "/home/JohnNy64/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 73, in __init__ self._buildDoc() File "/home/JohnNy64/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 95, in _buildDoc self._extractTracks() File "/home/JohnNy64/.kde/share/apps/amarok/scripts/collection2html/Collection.py", line 111, in _extractTracks value = doc.pop() IndexError: pop from empty list The query select artist.name, album.name,sum(length),count(track),year.name from tags, album, artist, year where tags.album = album.id and tags.artist = artist.id and tags.year = year.id and album.name <> "" and tags.sampler = 0 group by tags.artist, tags.album, tags.year union select "Various Artists", album.name,sum(length),count(tags.track),year.name from tags, album, year where tags.album = album.id and tags.year = year.id and album.name <> "" and tags.sampler = 1 group by tags.album, tags. year doesn't return anything. But I don't know much about the SQL language, so I don't understand what it is supposed to do...

BorgQueen

I just tried out your amarok script and it works GREAT! This is very useful for parties and DJ events. You can just leave the list up for people to make requests. Thank you very much.

drnoone

Thanks! I'm glad you've found it useful. I've detected some problems with albums with the same name ("The Best of" for example). I'm releasing a new version before the end of the weeks. Regards drnoone

BorgQueen

Thanks, its greatly appreciated.

Pling
0 Affiliates
Details
license
version 0.1.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

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