added tagtypes and updated MPD version, gmpc now works (but keeps

trying 'outputs' command)

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%40156
This commit is contained in:
adrian.sampson 2009-04-01 21:51:36 +00:00
parent a94ea7f91d
commit e7f4283368

View file

@ -15,7 +15,7 @@ import time
DEFAULT_PORT = 6600 DEFAULT_PORT = 6600
PROTOCOL_VERSION = '0.12.2' PROTOCOL_VERSION = '0.13.0'
BUFSIZE = 1024 BUFSIZE = 1024
HELLO = 'OK MPD %s' % PROTOCOL_VERSION HELLO = 'OK MPD %s' % PROTOCOL_VERSION
@ -789,13 +789,36 @@ class BGServer(Server):
# The first three items need to be done more efficiently. The # The first three items need to be done more efficiently. The
# last three need to be implemented. # last three need to be implemented.
yield ('artists: ' + str(len(self.lib.artists())), yield ('artists: ' + str(len(self.lib.artists())),
'albums: ' + str(len(self.lib.albums())), 'albums: ' + str(len(self.lib.albums())),
'songs: ' + str(len(list(self.lib.items()))), 'songs: ' + str(len(list(self.lib.items()))),
'uptime: ' + str(int(time.time() - self.startup_time)), 'uptime: ' + str(int(time.time() - self.startup_time)),
'playtime: ' + '0', 'playtime: ' + '0',
'db_playtime: ' + '0', 'db_playtime: ' + '0',
'db_update: ' + str(int(self.startup_time)), 'db_update: ' + str(int(self.startup_time)),
) )
# Search functionality.
tagtype_map = {
'Artist': 'artist',
'Album': 'album',
'Title': 'title',
'Track': 'track',
# Name?
'Genre': 'genre',
'Date': 'year',
'Composer': 'composer',
# Performer?
'Disc': 'disc',
}
def cmd_tagtypes(self):
"""Returns a list of the metadata (tag) fields available for
searching.
"""
for tag in self.tagtype_map:
yield 'tagtype: ' + tag
# The functions below hook into the half-implementations provided # The functions below hook into the half-implementations provided
# by the base class. Together, they're enough to implement all # by the base class. Together, they're enough to implement all