From 3368f275886512485362e958b5b4de19ebbb5c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 2 May 2019 19:29:58 +0200 Subject: [PATCH] fix tag function logging; don't try to tag with None --- delojza.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/delojza.py b/delojza.py index 65536df..33354a7 100755 --- a/delojza.py +++ b/delojza.py @@ -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: