summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-08-25 12:14:10 +0200
committerAnton Khirnov <wyskas@gmail.com>2009-08-25 12:14:10 +0200
commit9bb81540939dfcb078f4b6eaed1e961cc5a34668 (patch)
tree920a89dc7f1602715c41e82f68e92284d2b1a882
parent09bb49dc791ee9631bc9d856df25ce5988422064 (diff)
song: if a tag has multiple values, choose first.
-rw-r--r--nephilim/plugins/Library.py2
-rw-r--r--nephilim/song.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nephilim/plugins/Library.py b/nephilim/plugins/Library.py
index f59d297..8090922 100644
--- a/nephilim/plugins/Library.py
+++ b/nephilim/plugins/Library.py
@@ -108,8 +108,6 @@ class LibraryWidget(QtGui.QWidget):
cur_item = tree
for part in grouping:
tag = song[part]
- if isinstance(tag, list):
- tag = tag[0] #FIXME is this the best solution?
if not tag:
tag = 'Unknown'
if tag in cur_item[0]:
diff --git a/nephilim/song.py b/nephilim/song.py
index d1ea869..65b6322 100644
--- a/nephilim/song.py
+++ b/nephilim/song.py
@@ -27,6 +27,8 @@ class Song(dict):
def __init__(self, data):
# decode all strings to unicode
for tag in data:
+ if isinstance(data[tag], list):
+ data[tag] = data[tag][0]
if isinstance(data[tag], str):
data[tag] = data[tag].decode('utf-8')