Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9589e70
Fix goodreads StopIteration bug and removed outdated bytes test - cod…
Sadashii Apr 2, 2026
e279e3a
Refactor Goodreads import feature layout and styles for improved usab…
Sadashii Apr 2, 2026
d798a60
Refactor Goodreads import feature: remove legacy JavaScript and updat…
Sadashii Apr 2, 2026
a8d4169
Enhance Goodreads import feature: support ISBN13 and improve error ha…
Sadashii Apr 2, 2026
7b0ad74
Revert unintended vendor/infogami submodule update
Sadashii Apr 3, 2026
2a84311
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
1b93bbb
Improve Goodreads import feature: enhance error handling, update UI e…
Sadashii Apr 3, 2026
b01ff13
Merge branch 'feat/improvements-to-goodreads-import-feature' of githu…
Sadashii Apr 3, 2026
a433a8d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
635f082
Refactor Goodreads import feature: remove unused code and improve she…
Sadashii Apr 3, 2026
5bb4659
Merge branch 'feat/improvements-to-goodreads-import-feature' of githu…
Sadashii Apr 3, 2026
d070b23
Enhance Goodreads import feature: add data_import setup and remove un…
Sadashii Apr 3, 2026
fe01d2b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
5e3237f
Fix ISBN resolution error handling in the Goodreads import feature
Sadashii Apr 3, 2026
d0267a8
Enhance Goodreads import feature: add importing ratings
Sadashii Apr 3, 2026
61911c3
Enhance Goodreads import feature: add handling for exclusive shelves …
Sadashii Apr 3, 2026
e483899
Enhance Goodreads import feature: batch bookself date read calls
Sadashii Apr 3, 2026
d1bf10f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
74f5857
Enhance Goodreads import feature: tidy up logic
Sadashii Apr 3, 2026
6ef8609
Merge branch 'feat/improvements-to-goodreads-import-feature' of githu…
Sadashii Apr 3, 2026
af9772f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
cb25c89
Enhance Goodreads import feature: improve bookshelf handling and UI u…
Sadashii Apr 3, 2026
55b6dba
Merge branch 'feat/improvements-to-goodreads-import-feature' of githu…
Sadashii Apr 3, 2026
6f7d8ef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 3, 2026
6fd13c8
Enhance Goodreads import feature: ignore 'Did Not Finish' shelf and u…
Sadashii Apr 10, 2026
9a3a3a3
Merge branch 'feat/improvements-to-goodreads-import-feature' of githu…
Sadashii Apr 10, 2026
94b5168
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
"path": "static/build/js/readinglog-stats.*.js",
"maxSize": "137KB"
},
{
"path": "static/build/js/goodreads-import.*.js",
"maxSize": "2KB"
},
{
"path": "static/build/js/admin.*.js",
"maxSize": "1.3KB"
Expand Down
84 changes: 77 additions & 7 deletions openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ msgstr ""
msgid "Create new list"
msgstr ""

#: CreateListModal.html EditButtons.html account/notifications.html
#: account/password/reset.html account/privacy.html admin/imports-add.html
#: admin/permissions.html books/add.html databarEdit.html interstitial.html
#: merge/authors.html my_books/dropdown_content.html type/list/edit.html
#: type/series/edit.html type/tag/form.html
#: CreateListModal.html EditButtons.html account/import.html
#: account/notifications.html account/password/reset.html account/privacy.html
#: admin/imports-add.html admin/permissions.html books/add.html
#: databarEdit.html interstitial.html merge/authors.html
#: my_books/dropdown_content.html type/list/edit.html type/series/edit.html
#: type/tag/form.html
msgid "Cancel"
msgstr ""

Expand Down Expand Up @@ -2870,15 +2871,84 @@ msgid "What are star ratings?"
msgstr ""

#: account/import.html
msgid "Importing..."
msgid "Import Books"
msgstr ""

#: account/import.html
msgid "Go to My Books"
msgstr ""

#: account/import.html
msgid "Books Ready to Import"
msgstr ""

#: account/import.html
msgid "Note:"
msgstr ""

#: account/import.html
msgid ""
"Books from your 'Did Not Finish' shelf will be skipped during import as "
"we do not currently support it. We plan to add support for this in the "
"future."
msgstr ""

#: account/import.html
msgid "Select all books ready to import"
msgstr ""

#: account/import.html
msgid "Reason"
msgstr ""

#: account/import.html
msgid "No ISBN"
msgid "No valid books with ISBNs found to import."
msgstr ""

#: account/import.html
msgid "Books Missing ISBNs"
msgstr ""

#: account/import.html
msgid ""
"Unfortunately, these books do not have ISBN codes and currently we can't "
"import these."
msgstr ""

#: account/import.html
msgid "Action"
msgstr ""

#: account/import.html
msgid "Search OL"
msgstr ""

#: account/import.html
msgid "Importing, please wait..."
msgstr ""

#: account/import.html
msgid "Imported"
msgstr ""

#: account/import.html
msgid "Unknown error"
msgstr ""

#: account/import.html
msgid "Something went wrong. Try again."
msgstr ""

#: account/import.html
msgid "Import 1 Book"
msgstr ""

#: account/import.html
msgid "Import {count} Books"
msgstr ""

#: account/import.html
msgid "Done - {succeeded} imported, {errors} failed"
msgstr ""

#: account/loan_history.html
Expand Down
182 changes: 0 additions & 182 deletions openlibrary/plugins/openlibrary/js/goodreads_import.js

This file was deleted.

5 changes: 0 additions & 5 deletions openlibrary/plugins/openlibrary/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ jQuery(function () {
});
}

// conditionally loads Goodreads import based on class in the page
if (document.getElementsByClassName('import-table').length) {
import(/* webpackChunkName: "goodreads-import" */'./goodreads_import.js')
.then(module => module.initGoodreadsImport());
}
// conditionally load list seed item deletion dialog functionality based on id on lists pages
if (document.getElementById('listResults')) {
import(/* webpackChunkName: "ListViewBody" */'./lists/ListViewBody.js');
Expand Down
16 changes: 13 additions & 3 deletions openlibrary/plugins/upstream/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ def GET(self):

@require_login
def POST(self):
books, books_wo_isbns = process_goodreads_csv(web.input())
input_csv = web.input(csv={})
books, books_wo_isbns = process_goodreads_csv(input_csv)
return render['account/import'](books, books_wo_isbns)


Expand Down Expand Up @@ -1379,8 +1380,17 @@ def g(*a, **kw):


def process_goodreads_csv(i):

csv_payload = i.csv if isinstance(i.csv, str) else i.csv.decode()
if hasattr(i.csv, 'file'):
i.csv.file.seek(0)
raw_bytes = i.csv.file.read()
else:
raw_bytes = i.csv

csv_payload = (
raw_bytes
if isinstance(raw_bytes, str)
else raw_bytes.decode('utf-8', errors='replace')
)
csv_file = csv.reader(csv_payload.splitlines(), delimiter=',', quotechar='"')
header = next(csv_file)
books = {}
Expand Down
2 changes: 2 additions & 0 deletions openlibrary/plugins/upstream/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
borrow, # noqa: F401 side effects may be needed
checkins,
covers,
data_import,
edits,
merge_authors,
models,
Expand Down Expand Up @@ -386,6 +387,7 @@ def setup():
edits.setup()
checkins.setup()
yearly_reading_goals.setup()
data_import.setup()

from openlibrary.plugins.upstream import data, jsdef

Expand Down
Loading
Loading