random: py26 fix

This commit is contained in:
Adrian Sampson 2013-06-12 16:09:41 -07:00
parent 03a2bedac3
commit 4555d69803
2 changed files with 5 additions and 1 deletions

View file

@ -40,7 +40,9 @@ def random_item(lib, opts, args):
# Group the objects by artist so we can sample from them.
key = attrgetter('albumartist')
objs.sort(key=key)
objs_by_artists = {artist: list(v) for artist, v in groupby(objs, key)}
objs_by_artists = {}
for artist, v in groupby(objs, key):
objs_by_artists[artist] = list(v)
objs = []
for _ in range(opts.number):

View file

@ -39,6 +39,8 @@ And some bug fixes:
* :doc:`/plugins/scrub`: Handle and log I/O errors.
* :doc:`/plugins/lyrics`: The Google backend should now turn up more results.
Thanks to Fabrice Laporte.
* :doc:`/plugins/random`: Fix compatibility with Python 2.6. Thanks to
Matthias Drochner.
1.2.0 (June 5, 2013)