fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a6491f
)
fix except clauses in bookmedia
author
Jan Szejko
<janek37@gmail.com>
Wed, 19 Oct 2016 11:36:24 +0000
(13:36 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Wed, 19 Oct 2016 11:36:24 +0000
(13:36 +0200)
src/catalogue/models/bookmedia.py
patch
|
blob
|
history
diff --git
a/src/catalogue/models/bookmedia.py
b/src/catalogue/models/bookmedia.py
index
1f984a0
..
39ebf49
100644
(file)
--- a/
src/catalogue/models/bookmedia.py
+++ b/
src/catalogue/models/bookmedia.py
@@
-124,13
+124,13
@@
class BookMedia(models.Model):
audio = id3.ID3(filepath)
return [t.data for t in audio.getall('PRIV')
if t.owner == 'wolnelektury.pl?flac_sha1'][0]
- except
MutagenError
:
+ except
(MutagenError, IndexError)
:
return None
elif filetype == 'ogg':
try:
audio = mutagen.File(filepath)
return audio.get('flac_sha1', [None])[0]
- except (MutagenError, AttributeError):
+ except (MutagenError, AttributeError
, IndexError
):
return None
else:
return None