Re: [Deskbar] Rhythmbox Handler



Alright, an updated version of the plugin is up at
http://byte.csc.lsu.edu/~rrouss7/deskbar_plugins/rhythmbox/rhythmbox.py

I use xml.parsers.expat to parse ~/.gnome2/rhythmbox/rhythmdb.xml

I also set the Library handler to return only 5 results per query
(which may fix some of the slowness)

As far as placing the results in their own category, I'm not aware of
a way to create a new category (like 'Music').  Perhaps the Deskbar
team can enlighten me.

I still think keeping a list of the songs is the more efficient way to
handle them (see the Muine example at
http://live.gnome.org/DeskbarApplet/Extending).  In my opinion it's
better to parse the file only when it is changed and create the list
of X songs (~2700 in your case) rather than parse the file every time
there is a query sent to the handler.

I don't think very much space is needed by the list of songs anyhow.
Currently it's a list of tuples containing (song title, artist name,
file path).  I would guess that most of these have a combined total of
75-150 characters.  Even with the Python object overhead, a list of
3000 songs should still be less than 1 Mb which is manageable.

I just really don't like the idea of parsing the file every single
time a query is sent (everytime a character is pressed, especially if
the person is not searching for music).  If I could find a way around
that I wouldn't mind making a change, but until then I'm going to keep
the songs in a list.

Try it out again and see if limiting the query results helped the speed.

Thanks for the suggestions,
Ryan R.

On 7/20/06, Sebastian Pölsterl <marduk k-d-w org> wrote:
I just had a closer look at your handler.

I think it's a bad idea to put the hole files in the library dir in an
dictionary and search that one. I've got ~2700 files, therefore your way
needs much space and is awefully slow.
I think it's a better idea to use the XML file rhythmbox creates located
in ~/.gnome2/rhythmbox/rhythmdb.xml

A fast XML parser like ElementTree should parse this file quite fast.

Furthermore, the results should be displayed in it's own category.

Nevertheless, I still like your idea.

--
Greetings,
Sebastian Pölsterl
_______________________________________________
deskbar-applet-list mailing list
deskbar-applet-list gnome org
http://mail.gnome.org/mailman/listinfo/deskbar-applet-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]