fix tag function logging; don't try to tag with None

feature-unify_handlers
Tomáš Mládek 2019-05-02 19:29:58 +02:00
parent e5c66265f3
commit 3368f27588
1 changed files with 5 additions and 1 deletions

View File

@ -134,8 +134,12 @@ class DelojzaBot:
artist = artist.strip() if artist else None
title = title.strip() if title else None
if title is None and artist is None:
message.reply_text("Tried tagging, found nothing :(")
return
message.reply_text("Tagging as \"{}\" by \"{}\"\nvia {}".format(title, artist, source))
self.logger.info("Tagging %s w/ $s - $s [%s]...".format(filepath, title, artist, source))
self.logger.info("Tagging {} w/ {} - {} [{}]...".format(filepath, title, artist, source))
try:
id3 = mutagen.id3.ID3(filepath)
except mutagen.id3.ID3NoHeaderError: