From fffa530e2eda1c42ac1c4c72e17ea2ddf61f112c Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sat, 8 Jul 2006 14:45:59 -0800 Subject: [PATCH] add bitrate in front of the name, and when comparing, skip over it.. [git-p4: depot-paths = "//depot/": change = 841] --- shoutcast.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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