mirror of
https://github.com/beetbox/beets.git
synced 2026-01-07 00:15:20 +01:00
lyrics safely decoded from bytes
This commit is contained in:
parent
2d3c9d9f9a
commit
5befad8ba0
2 changed files with 4 additions and 0 deletions
|
|
@ -455,6 +455,8 @@ class MediaField(object):
|
|||
if self.out_type == bool:
|
||||
# store bools as 1,0 instead of True,False
|
||||
out = unicode(int(out))
|
||||
elif isinstance(out, str):
|
||||
out = out.decode('utf8', 'ignore')
|
||||
else:
|
||||
out = unicode(out)
|
||||
elif style.as_type == int:
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ def get_lyrics(artist, title):
|
|||
for backend in BACKENDS:
|
||||
lyrics = backend(artist, title)
|
||||
if lyrics:
|
||||
if isinstance(lyrics, str):
|
||||
lyrics = lyrics.decode('utf8', 'ignore')
|
||||
return lyrics
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue