encode error bugs due to absent ID3 tag resolved

This commit is contained in:
Nimesh Ghelani 2014-05-28 01:25:06 +05:30
parent 8b38b0fb90
commit b408be48de

View file

@ -246,7 +246,9 @@ class Track(Record):
text = " - ".join(audio.get("title", "") + audio.get("artist", "")) text = " - ".join(audio.get("title", "") + audio.get("artist", ""))
# Handle the VoiceOverData # Handle the VoiceOverData
self["dbid"] = hashlib.md5(text.encode("latin-1", "ignore")).digest()[:8] #pylint: disable-msg=E1101 if type(text) != type(''):
text = text.encode('utf8', 'ignore')
self["dbid"] = hashlib.md5(text).digest()[:8] #pylint: disable-msg=E1101
self.text_to_speech(text, self["dbid"]) self.text_to_speech(text, self["dbid"])
class PlaylistHeader(Record): class PlaylistHeader(Record):