Skip to content

Index group libraries, gated by an indexing-scope preference #41

Description

@introfini

Summary

ZotSeek's bulk "Update Library Index" only indexes My Library, while auto-index
(when enabled) already indexes items from any library, including groups. This is
inconsistent, and there is no way to control which libraries get indexed.

Add first-class support for indexing group libraries, controlled by a single
indexing-scope preference that both the bulk action and auto-index respect.

Current behavior

  • Manual "Update Library Index" indexes only the user library
    (getLibraryItems() on userLibraryID).
  • Auto-index (zotseek.autoIndex): shouldProcess() in
    src/core/auto-index-manager.ts applies no library filter, so new items in
    group libraries are already indexed as they arrive.
  • The storage layer is already library-aware: everything is keyed by
    (library_key, item_key), and the search engine can filter by libraryId
    via store.getByLibrary().

So the only missing pieces are a bulk entry point for group libraries and user
control over scope.

Proposed behavior

Introduce a preference that decides which libraries ZotSeek indexes:

zotseek.indexScope = "user" (default) | "all" | "group:123,group:456"
  • Default "user" (My Library only). Group content is opt-in, so upgrading does
    not silently start indexing shared group libraries.
  • The preference governs BOTH paths:
    • onIndexLibrary() in src/index.ts (bulk): pick getAllLibraryItems() vs
      getLibraryItems() based on the preference.
    • shouldProcess() in src/core/auto-index-manager.ts: reject items whose
      libraryID is out of scope. Auto-index cannot prompt the user, which is why
      scope must be a persisted preference rather than a per-click menu choice.
  • The value format is extensible on purpose: the v1 UI can be a simple
    "My Library only / All libraries" toggle, while a future per-library selector
    (group:123,group:456) needs no preference migration.

UI

A dropdown in the ZotSeek preferences pane, next to the indexing settings.
v1: My Library only (default) / All libraries.

Acceptance criteria

  • New zotseek.indexScope preference, default "user", with a UI control.
  • Bulk index and auto-index both honor it.
  • Menu / confirm / resume strings reflect the active scope.
  • Existing resume markers (type: 'library' scope) keep working.

Related

PR #40 adds the multi-library bulk plumbing (getAllLibraries(),
getAllLibraryItems(), MCP library_key) and fixes a group-collection resume
bug. It currently flips the default to index all libraries; this issue narrows
that to the opt-in preference described above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions