make all books public by default (revert visibility gating)
All checks were successful
Release / Test backend (push) Successful in 5m47s
Release / Test UI (push) Successful in 1m4s
Release / Build and push images (push) Successful in 6m20s
Release / Deploy to prod (push) Successful in 3m53s
Release / Deploy to homelab (push) Successful in 8s
Release / Gitea Release (push) Successful in 25s

This commit is contained in:
root
2026-04-27 11:46:05 +05:00
parent 51adf0e7a5
commit 7351756056
2 changed files with 43 additions and 2 deletions

View File

@@ -86,12 +86,11 @@ func (s *Store) WriteMetadata(ctx context.Context, meta domain.BookMeta) error {
return fmt.Errorf("WriteMetadata: %w", err)
}
if err == ErrNotFound {
// New scraped book — default to admin_only visibility.
postPayload := make(map[string]any, len(patchPayload)+1)
for k, v := range patchPayload {
postPayload[k] = v
}
postPayload["visibility"] = domain.VisibilityAdminOnly
postPayload["visibility"] = domain.VisibilityPublic
postErr := s.pb.post(ctx, "/api/collections/books/records", postPayload, nil)
if postErr == nil {
return nil