Querying Amarok Stats

I’ve been using Amarok to manage my music collection for a couple of months now. I love this open source stuff because they are never afraid of letting you look at their work.
For example Amarok manages your music files and keeps various statistics. The player doesn’t list of an obvious way to display the cummulative file size of a group of songs. However, since the Amarok database uses SQLite its a piece of cake to write your own SQL queries.

So, after looking at the Amarok wiki I was able to create and paste the following script in the command line and get a quick printout of my genres and how many megabytes of files are in each genre (this is with Amarok 1.4):

dcop amarok collection query "select g.name, ((sum(filesize)/1024)/1024) as size from tags t, genre g where t.genre = g.id group by t.genre order by sum(filesize) desc;"