From d47b4b6575c295d430a03cea737cf0fb07484f6b Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Sun, 10 Jan 2021 18:21:04 +1100 Subject: [PATCH] Fix exception when artist name is empty --- sublime_music/adapters/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sublime_music/adapters/manager.py b/sublime_music/adapters/manager.py index b094f82..36cd771 100644 --- a/sublime_music/adapters/manager.py +++ b/sublime_music/adapters/manager.py @@ -1183,9 +1183,9 @@ class AdapterManager: def _strip_ignored_articles( use_ground_truth_adapter: bool, ignored_articles: Set[str], string: str ) -> str: - first_word, *rest = string.split(maxsplit=1) - if first_word in ignored_articles: - return rest[0] + parts = string.split(maxsplit=1) + if len(parts) > 1 and parts[0] in ignored_articles: + return parts[1] return string _S = TypeVar("_S")