1
0
Fork 0

Refactor hard-coded strings with a reference to a static property

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
André Jaenisch 2022-05-05 13:07:25 +02:00
parent eeb1cc7197
commit 6bd9b725e2
No known key found for this signature in database
GPG key ID: 5A668E771F1ED854
6 changed files with 16 additions and 13 deletions

View file

@ -1,5 +1,8 @@
""" handle reading a tsv from librarything """
import re
from bookwyrm.models import Shelf
from . import Importer
@ -21,7 +24,7 @@ class LibrarythingImporter(Importer):
def get_shelf(self, normalized_row):
if normalized_row["date_finished"]:
return "read"
return Shelf.READ_FINISHED
if normalized_row["date_started"]:
return "reading"
return "to-read"
return Shelf.READING
return Shelf.TO_READ