Give a library book one form in the API

A book from the search, from the list of library candidates and from a
lookup now has the same fields, with the authors as a list.
This commit is contained in:
tim
2026-10-03 08:09:41 +02:00
parent 22478c3a56
commit 89709f875a
7 changed files with 31 additions and 22 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ def test_library_search_link_import_and_unlink(client, story, monkeypatch):
cwa.get_book.return_value = book.to_dict()
monkeypatch.setattr(o, "cwa", lambda: cwa)
monkeypatch.setattr(config, "CWA_URL", "https://cwa.example")
assert client.get("/api/library/candidates").json[0]["calibre_id"] == 7
assert client.get("/api/library/candidates").json[0]["id"] == 7
assert client.get("/api/library/search?q=Title").json[0]["tracked_as"] is None
cwa.search.assert_called_once_with("Title")
linked = client.post(f"/api/stories/{sid}/link", json={"uuid": "book-7"}, headers=H)