From 3d1b0fb84d9bee823dc4604b0d26b8e2f01ac9be Mon Sep 17 00:00:00 2001 From: Stef Piatek Date: Wed, 11 Sep 2024 16:06:32 +0100 Subject: [PATCH 1/2] Strip whitespace in case of leading whitespace --- src/bbc_meet_spotify/music.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bbc_meet_spotify/music.py b/src/bbc_meet_spotify/music.py index d5bdeb4..20e1194 100644 --- a/src/bbc_meet_spotify/music.py +++ b/src/bbc_meet_spotify/music.py @@ -27,7 +27,7 @@ def clean_string(string): [char for char in unicodedata.normalize("NFD", string) if unicodedata.category(char) != "Mn"] ) new_string = re.sub("[^A-Za-z0-9.'’]+", " ", new_string) - return new_string.lower().split(" feat.")[0].split(" ft.")[0] + return new_string.lower().split(" feat.")[0].split(" ft.")[0].strip() def to_string(self): """Get string value for album or song""" From 4862524a8fa215179d9cdeb03bc88ca1ce229df3 Mon Sep 17 00:00:00 2001 From: Stef Piatek Date: Wed, 11 Sep 2024 16:13:52 +0100 Subject: [PATCH 2/2] Update test data to avoid whitespace regression --- tests/resources/dance-party-2021_standalone.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/dance-party-2021_standalone.html b/tests/resources/dance-party-2021_standalone.html index 78a2d58..4d68343 100644 --- a/tests/resources/dance-party-2021_standalone.html +++ b/tests/resources/dance-party-2021_standalone.html @@ -2630,7 +2630,7 @@

- Maduk + Maduk