Skip to content

Commit

Permalink
fix for #26
Browse files Browse the repository at this point in the history
  • Loading branch information
paperboi committed May 25, 2021
1 parent 56bce3d commit 5174435
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions kindle2notion/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,12 @@ def _add_parsed_items_to_books_dict(books: Dict, title: str, author: str, highli
def _parse_raw_author_and_title(raw_clipping_list: List) -> Tuple[str, str]:
author = ""
title = raw_clipping_list[0].replace(author, '').strip().replace(u'\ufeff', '').replace(' ()', '')
<<<<<<< HEAD

if (re.findall(r'\(.*?\)', raw_clipping_list[0])):
author = (re.findall(r'\(.*?\)', raw_clipping_list[0]))[-1]
author = author.removeprefix('(').removesuffix(')')
else:
print("For"+ title + ", No author found. You can manually add the Author details in the Notion database.")
=======
if ((re.findall(r'\(.*?\)', raw_clipping_list[0]))):
author = (re.findall(r'\(.*?\)', raw_clipping_list[0]))[0]
# author comes in the format '(Lastname, Firstname)'
author = author.removeprefix('(').removesuffix(')')
else:
print("For"+ title + ", no author was found in clippings file. You can manually edit your clippings file to add Author in the format: <Title: (Lastname, Firstname)>. For now continuing with empty author name")
>>>>>>> de3716edaeeafd2a78acd4fb0153733b112f2dc8
return author, title


Expand Down

0 comments on commit 5174435

Please sign in to comment.