Only use added_date as start_date for books being read right now.

This commit is contained in:
Adam Kelly 2020-04-25 11:29:30 +01:00
parent 60dabe442e
commit 2006b2fbce

View file

@ -111,12 +111,14 @@ class ImportItem(models.Model):
@property @property
def reads(self): def reads(self):
return [ReadThrough( if (self.shelf == 'reading'
# date_added isn't the start date, but maybe better than nothing. and self.date_added and not self.date_read):
start_date=self.date_added, return [ReadThrough(start_date=self.date_added)]
finish_date=self.date_read, if self.date_read:
pages_read=None, return [ReadThrough(
)] finish_date=self.date_read,
)]
return []
def __repr__(self): def __repr__(self):
return "<GoodreadsItem {!r}>".format(self.data['Title']) return "<GoodreadsItem {!r}>".format(self.data['Title'])