Skip to content

Commit 1fc755b

Browse files
committed
fix(album-search): 🐛 remove qutotations around author name when shortening to initials
fixes #67
1 parent 0645c16 commit 1fc755b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Contents/Code/search_tools.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,18 @@ def check_if_preorder(self, book_date):
202202
def name_to_initials(self, input_name):
203203
"""
204204
Converts a name to initials.
205+
Shorten input_name by splitting on whitespaces
206+
Only the surname stays as whole, the rest gets truncated
207+
and merged with dots.
205208
Example: 'Arthur Conan Doyle' -> 'A.C.Doyle'
206209
Example: 'J K Rowling' -> 'J.K.Rowling'
207210
Example: 'J. R. R. Tolkien' -> 'J.R.R.Tolkien'
208211
"""
209-
# Shorten input_name by splitting on whitespaces
210-
# Only the surname stays as whole, the rest gets truncated
211-
# and merged with dots.
212+
213+
# Remove quotation marks
214+
input_name = input_name.replace('"', '')
215+
216+
# Split name into parts
212217
name_parts = self.clear_contributor_text(input_name).split()
213218

214219
# Check if prename and surname exist, otherwise exit

0 commit comments

Comments
 (0)