diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-05-17 13:19:53 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-05-17 13:19:53 +0200 |
commit | e8aa034e14a7a259089680ae366b12dc82d10fae (patch) | |
tree | d8ab83aae3e2afbfb8467ab3dc2c93c1a966da61 /nephilim/song.py | |
parent | d175a47b966c2c2d1569626a7699e1ff1a5bf36b (diff) |
song: correctly parse ogg track numbers.
Diffstat (limited to 'nephilim/song.py')
-rw-r--r-- | nephilim/song.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nephilim/song.py b/nephilim/song.py index 8f672ba..bc0d1c4 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -33,7 +33,11 @@ class Song: try: self._data['track'] = int(self._data['track']) except ValueError: - self._data['track'] = 0 + # OGG tracks come in #track/#total format + try: + self._data['track'] = int(self._data['track'].split('/')[0]) + except ValueError: + self._data['track'] = 0 # ensure all string-values are utf-8 encoded for tag in self._data.keys(): |