'Returns the number and total time of songs matching the
tag/value query.'

def cmd_count(self, conn, tag, value):

    (_, key) = self._tagtype_lookup(tag)
    songs = 0
    playtime = 0.0
    for item in self.lib.items(dbcore.query.MatchQuery(key, value)):
        songs += 1
        playtime += item.length
    (yield (u'songs:    ' + six.text_type(songs)))
    (yield (u'playtime:    ' + six.text_type(int(playtime))))
