Skip to content

Conversation

@lucalbus
Copy link

In the bookwyrm import, fetch reading dates (start date, finish date, stopped date), book status (based on shelf or reading dates) and the date the book has been added to one's book list

@lucalbus lucalbus changed the title feat: Import status, readings & date added form bookwyrm feat: Import status, readings & date added from bookwyrm Oct 24, 2025
}
}

if (startDate != null || finishDate != null || stoppedDate != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a concern about writing incomplete Reading to the DB, but apparently it's allowed and done in the past:

// finishing the book
if (status == BookStatus.inProgress) {
final rating = await _getQuickRating(context);
book = book.copyWith(
status: BookStatus.read,
rating: rating,
readings: book.readings.isNotEmpty
? (book.readings..[0] = book.readings[0].copyWith(finishDate: date))
: [Reading(finishDate: date)],
);
} else if (status == BookStatus.forLater) {
book = book.copyWith(
status: BookStatus.inProgress,
readings: book.readings.isNotEmpty
? (book.readings..[0] = book.readings[0].copyWith(startDate: date))
: [Reading(startDate: date)],
);
} else if (status == BookStatus.unfinished) {
book = book.copyWith(
status: BookStatus.inProgress,
readings: book.readings.isNotEmpty
? (book.readings..[0] = book.readings[0].copyWith(startDate: date))
: [Reading(startDate: date)],
);
}

Copy link

@RomanKovtyukh RomanKovtyukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants