Adds shelf mappings

This commit is contained in:
Mouse Reeve
2021-11-11 12:29:38 -08:00
parent 147dd95e8d
commit f3bcced0a0
3 changed files with 20 additions and 1 deletions

View File

@ -17,3 +17,10 @@ class LibrarythingImporter(Importer):
date = normalized[date_field]
normalized[date_field] = re.sub(r"\[|\]", "", date)
return normalized
def get_shelf(self, normalized_row):
if normalized_row["date_finished"]:
return "read"
if normalized_row["date_started"]:
return "reading"
return "to-read"