diff --git a/shoutcast.py b/shoutcast.py index 3b04157..c4718a7 100644 --- a/shoutcast.py +++ b/shoutcast.py @@ -261,6 +261,10 @@ class ShoutStation(AudioItem): self.station['MimeType'].encode('ascii')) self.bitrate = self.station['Bitrate'] * 128 # 1024k / 8bit +def stationwbitratecmp(x, y): + x, y = map(lambda x: x.split('-', 1)[1], (x, y)) + return cmp(x, y) + class ShoutGenre(MusicGenre): def __init__(self, *args, **kwargs): self.genre = kwargs['genre'] @@ -319,7 +323,8 @@ class ShoutGenre(MusicGenre): doupdate = True self.pathObjmap[name] = self.cd.addItem(self.id, - ShoutStation, name, station = i) + ShoutStation, '%sk-%s' % (i['Bitrate'], name), + station = i) self.sl = stations