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,6 +208,12 @@ class DelojzaBot:
filenames.append(final_filename) filenames.append(final_filename)
if audio and is_mp3: if audio and is_mp3:
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) self.tag_file(final_filename, message)
return filenames return filenames