Skip to content

feat(zotero): support multiple Zotero libraries via per-source library ID - #93

Open
psuckrow-routine wants to merge 2 commits into
open-webui:mainfrom
psuckrow-routine:feat/multi-library-zotero
Open

feat(zotero): support multiple Zotero libraries via per-source library ID#93
psuckrow-routine wants to merge 2 commits into
open-webui:mainfrom
psuckrow-routine:feat/multi-library-zotero

Conversation

@psuckrow-routine

Copy link
Copy Markdown

Extends the zotero: source syntax to accept an optional numeric library ID prefix, enabling multiple Zotero libraries in a single daemon instance.

Source syntax — embed the library ID before the collection path: zotero:123456: or zotero:123456:Collection%%Sub. Plain collection paths (e.g. zotero:Research%%ML) are unchanged — collection names are not purely numeric so there is no ambiguity.

Per-library env vars — a new _zotero_env(key, library_id) helper resolves ZOTERO_*_<library_id> overrides with a fallback to the global ZOTERO_*. Covers all connector settings: API key, library type, checksum mode, notes/annotations, exclude patterns, unfiled dir, and WebDAV credentials.

Pierre-Louis Suckrow added 2 commits August 3, 2026 10:46
Embed an optional numeric library ID in the source string to allow
multiple Zotero libraries to be synced from a single daemon instance:

  source: "zotero:123456:"              # all collections in library 123456
  source: "zotero:123456:Research%%ML"  # specific collection

When a library ID is present the connector resolves credentials from
per-library env vars before falling back to the global defaults:

  ZOTERO_API_KEY_<library_id>      → ZOTERO_API_KEY
  ZOTERO_LIBRARY_TYPE_<library_id> → ZOTERO_LIBRARY_TYPE

Existing source strings ("zotero:" or "zotero:Collection%%Sub") are
fully backward-compatible — collection names are not purely numeric so
there is no ambiguity when parsing.
Introduce _zotero_env(key, library_id, default) which checks
ZOTERO_<KEY>_<library_id> before falling back to ZOTERO_<KEY>. Apply
it uniformly to every configurable setting so that each source entry
in .oikb.yaml can be tuned independently when multiple libraries are
in use:

  ZOTERO_CHECKSUM_<id>              overrides  ZOTERO_CHECKSUM
  ZOTERO_INCLUDE_NOTES_<id>                    ZOTERO_INCLUDE_NOTES
  ZOTERO_INCLUDE_ANNOTATIONS_<id>              ZOTERO_INCLUDE_ANNOTATIONS
  ZOTERO_LIBRARY_TYPE_<id>                     ZOTERO_LIBRARY_TYPE
  ZOTERO_EXCLUDE_<id>                          ZOTERO_EXCLUDE
  ZOTERO_UNFILED_DIR_<id>                      ZOTERO_UNFILED_DIR
  ZOTERO_WEBDAV_{URL,USER,PASSWORD}_<id>       ZOTERO_WEBDAV_*

Single-library setups are unaffected — the helper falls through to the
global vars unchanged.
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.

1 participant