From 9894e8752ba375a8f1734099e85dde48536222f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Mon, 17 Jul 2017 11:49:35 -0400 Subject: [PATCH] ignore trailing/leading whitespace when comparing artists --- beetsplug/lyrics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index f2a59c5b5..acd1ab99d 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -759,7 +759,7 @@ class LyricsPlugin(plugins.BeetsPlugin): This will keep state (in the `rest` variable) in order to avoid writing continuously to the same files. """ - if item is None or self.artist != item.artist: + if item is None or self.artist != item.artist.strip(): if self.rest is not None: slug = re.sub(r'\W+', '-', unidecode(self.artist.strip()).lower()) @@ -769,10 +769,10 @@ class LyricsPlugin(plugins.BeetsPlugin): self.rest = None if item is None: return - self.artist = item.artist + self.artist = item.artist.strip() self.rest = u"%s\n%s\n\n.. contents::\n :local:\n\n" \ - % (self.artist.strip(), - u'=' * len(self.artist.strip())) + % (self.artist, + u'=' * len(self.artist)) if self.album != item.album: tmpalbum = self.album = item.album if self.album == '':