don't try to tag unnecessarily

This commit is contained in:
Tomáš Mládek 2019-05-03 11:45:46 +02:00
parent 56635b60f1
commit 9471aad4ba

View file

@ -208,7 +208,13 @@ class DelojzaBot:
filenames.append(final_filename)
if audio and is_mp3:
self.tag_file(final_filename, message)
try:
id3 = mutagen.id3.ID3(final_filename)
untagged = 'TIT2' not in id3
except mutagen.id3.ID3NoHeaderError:
untagged = True
if untagged:
self.tag_file(final_filename, message)
return filenames