collection2html
Amarok 1.x Scripts
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

Changelog:

8 years ago

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!)

8 years ago

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

Report

9 years ago

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

Report

9 years ago

jayenell

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

Report

9 years ago

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

Report

9 years ago

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

Report

9 years ago

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.

Report

8 years ago

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

Report

8 years ago

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...

Report

9 years ago

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.

Report

9 years ago

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

Report

9 years ago

BorgQueen

Thanks, its greatly appreciated.

Report

Supporters

Recent Donations

Be the first to donate
Filename Version Description Filetype Packagetype License Downloads Date Filesize Install
Score 50%
50.00 Likes
50 Dislikes

0 Supporters for collection2html:

Recent Donations:

Be the first to donate
show all
Details
version
0.1.3
updated Jan 05 2009
added Jul 01 2007
downloads
page views 128
support drnoone
For The Product
collection2html
5 - 10 - 25 - 50 - 100 - 200 - 500