From ae09a1d981387110b84855d3ea7ee27462e68e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 29 May 2019 15:58:16 +0200 Subject: [PATCH] slight change in /retag (" - " instead of "-" is the artist/title split) --- delojza.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/delojza.py b/delojza.py index 23f4997..4f6a9bf 100755 --- a/delojza.py +++ b/delojza.py @@ -460,12 +460,11 @@ class DelojzaBot: update.message.reply_text(tmp_reply) def tg_retag(self, _, update): - message_is_sensible = update.message.text.count("-") == 1 - if self.last_downloaded.get(update.message.chat.id) is not None and message_is_sensible: + if self.last_downloaded.get(update.message.chat.id) is not None and " - " in update.message.text: files, hashtags, tumblr_ids = self.last_downloaded[update.message.chat.id] mp3s = [filename for filename in files if filename.endswith("mp3")] if len(mp3s) > 0: - tagline = re.sub(r'^/[\w]+', '', update.message.text).split("-") + tagline = re.sub(r'^/[\w]+', '', update.message.text).split(" - ") artist = tagline[0].strip() title = tagline[1].strip() for mp3 in mp3s: