Re: [Rhythmbox-devel] Rhythmbox Ampache (Source) plugin



On Thu, Feb 28, 2008 at 6:24 AM, Seva Epsteyn <seva sevatech com> wrote:
>
>  I've hacked up a Rhythmbox Ampache plugin in the last couple of days.  It
>  is usable but needs a lot more work.  If you are interested in testing it
>  please take a look at it here: http://sevatech.com/projects/rb-ampache/
>
>  See also: http://ampache.org/forums/t2067-Rhythmbox-Ampache-Plugin.html

I haven't tried this out at all as I don't have ampache installed
anywhere, but I have a few comments anyway..

General things first:
- Instead of storing usernames and passwords in gconf, it might be a
good idea to store them in gnome-keyring
- Why is the source group configurable? The ampache source should just
go in the 'shared' group
- Having the source icon configurable is a bit weird too..
- Does ampache publish its location using mdns or anything like that?
If so, it'd be good to automatically find local ampache servers

in AmpacheBrowser:

        def do_set_property(self, property, value):
                # No idea what this is
                if property.name == 'plugin':
                        self.__plugin = value
                else:
                        raise AttributeError, 'unknown property %s' %
property.name

you don't need this unless your source object is going to locate files
in the plugin install directory
(self.__plugin.find_file("something")).

                auth_xml =
urllib2.urlopen("%s?action=handshake&user=%s&auth=%s&timestamp=%s" %
(url, username, md5.md5(str(timestamp) + password).hexdigest(),
timestamp)).read()

If you use rb.Loader class to do this (and to fetch the song list),
the network activity will usually be asynchronous, so it won't block
the whole UI. Some restructuring would be required, as the loader
class operates using callbacks.

                for node in dom.getElementsByTagName("song"):
                        .. stuff ..

                self.db.commit()

If you do a self.db.commit() every 1000 songs or so, the songs will
appear in stages, rather than all at once; this tends to make it look
a bit more responsive.


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