fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ace9211
)
Str/bytes fix for publishing audiobooks.
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 17 Jun 2019 12:26:05 +0000
(14:26 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 17 Jun 2019 12:26:05 +0000
(14:26 +0200)
src/catalogue/models/bookmedia.py
patch
|
blob
|
history
diff --git
a/src/catalogue/models/bookmedia.py
b/src/catalogue/models/bookmedia.py
index
957e982
..
ec37849
100644
(file)
--- a/
src/catalogue/models/bookmedia.py
+++ b/
src/catalogue/models/bookmedia.py
@@
-99,10
+99,10
@@
class BookMedia(models.Model):
artist_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE1'))
director_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE3'))
project = ", ".join([
artist_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE1'))
director_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE3'))
project = ", ".join([
- t.data for t in audio.getall('PRIV')
+ t.data
.decode('utf-8')
for t in audio.getall('PRIV')
if t.owner == 'wolnelektury.pl?project'])
funded_by = ", ".join([
if t.owner == 'wolnelektury.pl?project'])
funded_by = ", ".join([
- t.data for t in audio.getall('PRIV')
+ t.data
.decode('utf-8')
for t in audio.getall('PRIV')
if t.owner == 'wolnelektury.pl?funded_by'])
except MutagenError:
pass
if t.owner == 'wolnelektury.pl?funded_by'])
except MutagenError:
pass
@@
-134,7
+134,7
@@
class BookMedia(models.Model):
if filetype == 'mp3':
try:
audio = id3.ID3(filepath)
if filetype == 'mp3':
try:
audio = id3.ID3(filepath)
- return [t.data for t in audio.getall('PRIV')
+ return [t.data
.decode('utf-8')
for t in audio.getall('PRIV')
if t.owner == 'wolnelektury.pl?flac_sha1'][0]
except (MutagenError, IndexError):
return None
if t.owner == 'wolnelektury.pl?flac_sha1'][0]
except (MutagenError, IndexError):
return None