Voile.ExternalBookSearch (Voile v0.1.27)

Copy Markdown View Source

External book search module that aggregates results from OpenLibrary, Google Books, and OpenAlex.

Use search_async/3 inside LiveView processes. It runs the HTTP work in Voile.TaskSupervisor so the LiveView socket is never blocked. Results are delivered as {:external_search_result, query, results} sent to the caller pid.

Summary

Functions

Synchronous search. Returns a (possibly empty) list of Book structs.

Asynchronous search for use inside LiveView processes.

Search a specific source only (bypasses cache).

Convert external book data to collection attributes for prefill.

Functions

search(query, opts \\ [])

Synchronous search. Returns a (possibly empty) list of Book structs.

search_async(query, caller_pid, opts \\ [])

Asynchronous search for use inside LiveView processes.

Runs HTTP work in Voile.TaskSupervisor so the LiveView socket is never blocked. Results are delivered as {:external_search_result, query, results} sent to caller_pid.

search_source(query, source, opts \\ [])

Search a specific source only (bypasses cache).

to_collection_attrs(external_book)

Convert external book data to collection attributes for prefill.