Skip to content

feat: Import status, readings & date added from bookwyrm - #844

Open
lucalbus wants to merge 2 commits into
mateusz-bak:masterfrom
lucalbus:bookwyrm-import
Open

lucalbus wants to merge 2 commits into
mateusz-bak:masterfrom
lucalbus:bookwyrm-import

Conversation

@lucalbus

Copy link
Copy Markdown

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) {

Copy link
Copy Markdown

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)],
);
}

@RomanKovtyukh RomanKovtyukh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me

@JonathanDoughty

Copy link
Copy Markdown

Claiming CSV import from BookWyrm without at least start date, end date, and rating makes Openreads a non-starter as a replacement for me. Will this PR get merged?

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.

3 participants