Skip to content

Commit

Permalink
feat(author-search): ✨ search/upgrade multi-author entries to single …
Browse files Browse the repository at this point in the history
…author entries

for example: `Jason Anspach, Nick Cole, Doc Spears` -> `Jason Anspach`
  • Loading branch information
djdembeck committed Oct 3, 2021
1 parent a18cda6 commit e5d70dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
@@ -1,6 +1,7 @@
{
"conventionalCommits.scopes": [
"search",
"update"
"update",
"author-search"
]
}
4 changes: 2 additions & 2 deletions Contents/Code/__init__.py
Expand Up @@ -72,13 +72,13 @@ def search(self, results, media, lang, manual):
if not result:
log.warn(
'No results found for query "%s"',
media.artist
search_helper.media.artist
)
return
log.debug(
'Found %s result(s) for query "%s"',
len(result),
media.artist
search_helper.media.artist
)

info = self.process_results(search_helper, result)
Expand Down
11 changes: 10 additions & 1 deletion Contents/Code/search_tools.py
Expand Up @@ -213,10 +213,19 @@ def parse_api_response(self, api_response):

def validate_author_name(self):
"""
Checks a list of known bad author names.
Checks for combined authors and a list of known bad author names.
If matched, author name is set to None to prevent
it being used in search query.
"""
if ',' in self.media.artist:
split_authors = self.media.artist.split(',')
log.info(
'Merging multi-author "' +
self.media.artist +
'" into top-level author "' +
split_authors[0] + '"'
)
self.media.artist = split_authors[0]
strings_to_check = [
"[Unknown Artist]"
]
Expand Down

0 comments on commit e5d70dd

Please sign in to comment.