diff --git a/cmd/server/main.go b/cmd/server/main.go
index e92e630..20d56e1 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -1,14 +1,14 @@
package main
import (
- "bookmann/internal/config"
- "bookmann/internal/database"
- "bookmann/internal/handlers"
- "bookmann/internal/middleware"
- ratelimit "bookmann/internal/middleware"
- "bookmann/internal/services"
- "bookmann/internal/sync"
- "bookmann/templates"
+ "bookhoard/internal/config"
+ "bookhoard/internal/database"
+ "bookhoard/internal/handlers"
+ "bookhoard/internal/middleware"
+ ratelimit "bookhoard/internal/middleware"
+ "bookhoard/internal/services"
+ "bookhoard/internal/sync"
+ "bookhoard/templates"
"bytes"
"context"
"log"
diff --git a/internal/handlers/analytics.go b/internal/handlers/analytics.go
index 7372127..60f5cca 100644
--- a/internal/handlers/analytics.go
+++ b/internal/handlers/analytics.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"net/http"
diff --git a/internal/handlers/auth.go b/internal/handlers/auth.go
index dba0f5a..401dae9 100644
--- a/internal/handlers/auth.go
+++ b/internal/handlers/auth.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/middleware"
+ "bookhoard/internal/database"
+ "bookhoard/internal/middleware"
"fmt"
"net/http"
"path/filepath"
diff --git a/internal/handlers/book_matching.go b/internal/handlers/book_matching.go
index 2575cbd..feaed5e 100644
--- a/internal/handlers/book_matching.go
+++ b/internal/handlers/book_matching.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/services"
+ "bookhoard/internal/database"
+ "bookhoard/internal/services"
"fmt"
"net/http"
"strconv"
@@ -294,7 +294,7 @@ func (h *Handler) AutoLinkBooks(c echo.Context) error {
bestMatch := match.Matches[0]
_, err := h.db.CreateDeviceFileAlias(ctx, database.CreateDeviceFileAliasParams{
- MediaItemID: pgtype.UUID{Bytes: bestMatch.BookmannUUID, Valid: true},
+ MediaItemID: pgtype.UUID{Bytes: bestMatch.BookhoardUUID, Valid: true},
DeviceID: book.DeviceID,
FilePath: book.FilePath.String,
FileSha256: pgtype.Text{String: "", Valid: false},
@@ -304,14 +304,14 @@ func (h *Handler) AutoLinkBooks(c echo.Context) error {
if err == nil {
h.db.LinkUnlinkedBook(ctx, database.LinkUnlinkedBookParams{
ID: book.ID,
- MediaItemID: pgtype.UUID{Bytes: bestMatch.BookmannUUID, Valid: true},
+ MediaItemID: pgtype.UUID{Bytes: bestMatch.BookhoardUUID, Valid: true},
ConfidenceScore: toFloat8(bestMatch.Confidence),
})
results = append(results, map[string]interface{}{
"unlinked_book_id": uuid.UUID(book.ID.Bytes).String(),
"title": book.Title.String,
- "matched_media_item_id": bestMatch.BookmannUUID.String(),
+ "matched_media_item_id": bestMatch.BookhoardUUID.String(),
"confidence": bestMatch.Confidence,
"match_method": bestMatch.MatchMethod,
})
diff --git a/internal/handlers/collections.go b/internal/handlers/collections.go
index 5fa19b2..706f2c3 100644
--- a/internal/handlers/collections.go
+++ b/internal/handlers/collections.go
@@ -1,9 +1,9 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/services"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ "bookhoard/internal/services"
+ wsync "bookhoard/internal/sync"
"encoding/json"
"fmt"
"net/http"
diff --git a/internal/handlers/collections_rules_test.go b/internal/handlers/collections_rules_test.go
index 25deab0..5abfdd2 100644
--- a/internal/handlers/collections_rules_test.go
+++ b/internal/handlers/collections_rules_test.go
@@ -3,7 +3,7 @@ package handlers
import (
"testing"
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"github.com/jackc/pgx/v5/pgtype"
"github.com/stretchr/testify/assert"
diff --git a/internal/handlers/collections_test.go b/internal/handlers/collections_test.go
index 7cf2272..84f77e3 100644
--- a/internal/handlers/collections_test.go
+++ b/internal/handlers/collections_test.go
@@ -3,7 +3,7 @@ package handlers
import (
"testing"
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"github.com/jackc/pgx/v5/pgtype"
"github.com/stretchr/testify/assert"
diff --git a/internal/handlers/conflicts.go b/internal/handlers/conflicts.go
index e770854..d3cb069 100644
--- a/internal/handlers/conflicts.go
+++ b/internal/handlers/conflicts.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ wsync "bookhoard/internal/sync"
"context"
"encoding/json"
"net/http"
diff --git a/internal/handlers/context.go b/internal/handlers/context.go
index 4108519..be35a02 100644
--- a/internal/handlers/context.go
+++ b/internal/handlers/context.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"net/http"
"github.com/labstack/echo/v4"
diff --git a/internal/handlers/devices.go b/internal/handlers/devices.go
index 789fcfb..241fef0 100644
--- a/internal/handlers/devices.go
+++ b/internal/handlers/devices.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/config"
- "bookmann/internal/database"
+ "bookhoard/internal/config"
+ "bookhoard/internal/database"
"crypto/rand"
"encoding/base64"
"encoding/json"
diff --git a/internal/handlers/ebook.go b/internal/handlers/ebook.go
index f3f9a5e..ec1ffca 100644
--- a/internal/handlers/ebook.go
+++ b/internal/handlers/ebook.go
@@ -1,9 +1,9 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/services"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ "bookhoard/internal/services"
+ wsync "bookhoard/internal/sync"
"context"
"fmt"
"net/http"
diff --git a/internal/handlers/kobo.go b/internal/handlers/kobo.go
index 65e94bb..b7a3314 100644
--- a/internal/handlers/kobo.go
+++ b/internal/handlers/kobo.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ wsync "bookhoard/internal/sync"
"crypto/sha256"
"encoding/hex"
"encoding/json"
@@ -25,9 +25,9 @@ func NewKoboHandler(db *database.Queries, connManager *wsync.ConnectionManager)
return &KoboHandler{db: db, connManager: connManager}
}
-// mapContentIdToBookmannUUID maps Kobo ContentId to Bookmann UUID with multiple fallback strategies
+// mapContentIdToBookhoardUUID maps Kobo ContentId to Bookmann UUID with multiple fallback strategies
// Phase 6: Enhanced Kobo Sync - ContentId Mapping Logic
-func (h *KoboHandler) mapContentIdToBookmannUUID(ctx echo.Context, contentId string, deviceID uuid.UUID) (uuid.UUID, error, string) {
+func (h *KoboHandler) mapContentIdToBookhoardUUID(ctx echo.Context, contentId string, deviceID uuid.UUID) (uuid.UUID, error, string) {
// Step 1: Try direct ContentId lookup in device_catalogs table
catalog, err := h.db.GetDeviceCatalogByKoboContentId(ctx.Request().Context(), contentId)
if err == nil && catalog.ID.Valid {
@@ -66,7 +66,7 @@ func (h *KoboHandler) mapContentIdToBookmannUUID(ctx echo.Context, contentId str
MediaItemID: pgtype.UUID{Bytes: mediaItem.ID.Bytes, Valid: true},
BookmannUuid: pgtype.UUID{Bytes: mediaItem.ID.Bytes, Valid: true},
KoboContentID: contentId,
- ContentIDType: pgtype.Text{String: "bookmann_uuid", Valid: true},
+ ContentIDType: pgtype.Text{String: "bookhoard_uuid", Valid: true},
Available: pgtype.Bool{Bool: true, Valid: true},
DeliveryDate: pgtype.Timestamptz{Time: time.Now(), Valid: true},
DeliveryMethod: pgtype.Text{String: "sync", Valid: true},
@@ -79,11 +79,11 @@ func (h *KoboHandler) mapContentIdToBookmannUUID(ctx echo.Context, contentId str
return uuid.Nil, fmt.Errorf("unlinked book: ContentId %s not found", contentId), "unlinked"
}
-// mapBookmannUUIDToKoboContentId maps Bookmann UUID to Kobo ContentId
+// mapBookhoardUUIDToKoboContentId maps Bookmann UUID to Kobo ContentId
// Creates new entry in device_catalogs if not exists
-func (h *KoboHandler) mapBookmannUUIDToKoboContentId(c echo.Context, bookmannUUID uuid.UUID, deviceID uuid.UUID) (string, error) {
+func (h *KoboHandler) mapBookhoardUUIDToKoboContentId(c echo.Context, bookmannUUID uuid.UUID, deviceID uuid.UUID) (string, error) {
// Check if catalog entry already exists
- catalog, err := h.db.GetDeviceCatalogByBookmannUUID(c.Request().Context(), database.GetDeviceCatalogByBookmannUUIDParams{
+ catalog, err := h.db.GetDeviceCatalogByBookhoardUUID(c.Request().Context(), database.GetDeviceCatalogByBookhoardUUIDParams{
DeviceID: pgtype.UUID{Bytes: deviceID, Valid: true},
BookmannUuid: pgtype.UUID{Bytes: bookmannUUID, Valid: true},
})
@@ -102,7 +102,7 @@ func (h *KoboHandler) mapBookmannUUIDToKoboContentId(c echo.Context, bookmannUUI
// 2. Use existing entitlement_id from media_items
// 3. Generate new "kobo_" prefixed UUID
var koboContentId string
- contentIdType := "bookmann_generated"
+ contentIdType := "bookhoard_generated"
if mediaItem.KoboContentID.Valid && mediaItem.KoboContentID.String != "" {
koboContentId = mediaItem.KoboContentID.String
@@ -226,7 +226,7 @@ type KoboLibraryBook struct {
MimeType string `json:"MimeType"`
FileSize int64 `json:"FileSize"`
Categories []string `json:"Categories,omitempty"`
- BookmannUUID string `json:"BookmannUUID,omitempty"`
+ BookhoardUUID string `json:"BookhoardUUID,omitempty"`
}
type KoboLibraryResponse struct {
@@ -319,7 +319,7 @@ func (h *KoboHandler) Initialization(c echo.Context) error {
}
// Phase 6: Use ContentId mapping instead of direct UUID
- koboContentId, err := h.mapBookmannUUIDToKoboContentId(c, bookmannUUID, deviceUUID)
+ koboContentId, err := h.mapBookhoardUUIDToKoboContentId(c, bookmannUUID, deviceUUID)
if err != nil {
// Fallback to entitlement_id or generate new one
if item.EntitlementID.Valid && item.EntitlementID.String != "" {
@@ -361,7 +361,7 @@ func (h *KoboHandler) Initialization(c echo.Context) error {
MimeType: mimeType,
FileSize: fileSize,
Categories: collections,
- BookmannUUID: bookmannUUID.String(),
+ BookhoardUUID: bookmannUUID.String(),
})
}
@@ -397,7 +397,7 @@ func (h *KoboHandler) Markup(c echo.Context) error {
for _, readingSync := range req.ReadingSync {
// Phase 6: Use ContentId mapping with fallback logic
- bookmannUUID, err, _ := h.mapContentIdToBookmannUUID(c, readingSync.ContentId, deviceUUID)
+ bookmannUUID, err, _ := h.mapContentIdToBookhoardUUID(c, readingSync.ContentId, deviceUUID)
if err != nil {
// Unlinked book detected
unlinkedBooks++
@@ -434,7 +434,7 @@ func (h *KoboHandler) Markup(c echo.Context) error {
for _, bookmarkSync := range req.BookmarkSync {
// Phase 6: Use ContentId mapping with fallback logic
- bookmannUUID, err, _ := h.mapContentIdToBookmannUUID(c, bookmarkSync.ContentId, deviceUUID)
+ bookmannUUID, err, _ := h.mapContentIdToBookhoardUUID(c, bookmarkSync.ContentId, deviceUUID)
if err != nil {
// Unlinked book - skip
continue
@@ -512,7 +512,7 @@ func (h *KoboHandler) Bookmark(c echo.Context) error {
for _, bookmarkSync := range req.BookmarkSync {
// Phase 6: Use ContentId mapping with fallback logic
- bookmannUUID, err, _ := h.mapContentIdToBookmannUUID(c, bookmarkSync.ContentId, deviceUUID)
+ bookmannUUID, err, _ := h.mapContentIdToBookhoardUUID(c, bookmarkSync.ContentId, deviceUUID)
if err != nil {
// Unlinked book - skip
continue
@@ -577,7 +577,7 @@ func (h *KoboHandler) AnalyticsGettests(c echo.Context) error {
for _, test := range req {
// Phase 6: Use ContentId mapping with fallback logic
- bookmannUUID, err, _ := h.mapContentIdToBookmannUUID(c, test.ContentId, deviceUUID)
+ bookmannUUID, err, _ := h.mapContentIdToBookhoardUUID(c, test.ContentId, deviceUUID)
if err != nil {
// Unlinked book - skip
continue
@@ -654,7 +654,7 @@ func (h *KoboHandler) SyncFromServer(c echo.Context) error {
for _, syncData := range req {
// Phase 6: Use ContentId mapping with fallback logic
- bookmannUUID, err, _ := h.mapContentIdToBookmannUUID(c, syncData.ContentId, deviceUUID)
+ bookmannUUID, err, _ := h.mapContentIdToBookhoardUUID(c, syncData.ContentId, deviceUUID)
if err != nil {
// Unlinked book - skip
continue
@@ -669,7 +669,7 @@ func (h *KoboHandler) SyncFromServer(c echo.Context) error {
UserID: pgUserID,
Percentage: pgtype.Float8{Float64: percentage, Valid: true},
LastSyncDevice: pgtype.Text{String: "kobo", Valid: true},
- LastSyncSource: pgtype.Text{String: "bookmann", Valid: true},
+ LastSyncSource: pgtype.Text{String: "bookhoard", Valid: true},
})
if err == nil {
diff --git a/internal/handlers/koreader.go b/internal/handlers/koreader.go
index 341024d..27add3c 100644
--- a/internal/handlers/koreader.go
+++ b/internal/handlers/koreader.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ wsync "bookhoard/internal/sync"
"encoding/json"
"fmt"
"net/http"
diff --git a/internal/handlers/library.go b/internal/handlers/library.go
index ba8bd6d..d8d0822 100644
--- a/internal/handlers/library.go
+++ b/internal/handlers/library.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/services"
+ "bookhoard/internal/database"
+ "bookhoard/internal/services"
"net/http"
"os"
"path/filepath"
diff --git a/internal/handlers/media.go b/internal/handlers/media.go
index 12489dd..9263fa8 100644
--- a/internal/handlers/media.go
+++ b/internal/handlers/media.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"io"
"mime"
"net/http"
diff --git a/internal/handlers/opds.go b/internal/handlers/opds.go
index 3fab35c..15ab21a 100644
--- a/internal/handlers/opds.go
+++ b/internal/handlers/opds.go
@@ -1,9 +1,9 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/opds"
- "bookmann/internal/services"
+ "bookhoard/internal/database"
+ "bookhoard/internal/opds"
+ "bookhoard/internal/services"
"context"
"crypto/rand"
"encoding/hex"
@@ -137,7 +137,7 @@ func (h *OPDSHandler) GetDeviceCatalog(c echo.Context) error {
// Create OPDS feed
feed := opds.NewFeed(
fmt.Sprintf("urn:uuid:%s", deviceID),
- "Bookmann Library",
+ "Bookhoard Library",
)
// Add feed links
@@ -187,7 +187,7 @@ func (h *OPDSHandler) GetDeviceCatalog(c echo.Context) error {
// Add SHA-256 metadata
if item.FileSha256.Valid {
- entry.AddMetadata("bookmann:sha256", item.FileSha256.String)
+ entry.AddMetadata("bookhoard:sha256", item.FileSha256.String)
}
// Add collections as categories
@@ -305,7 +305,7 @@ func (h *OPDSHandler) SearchDeviceCatalog(c echo.Context) error {
entry.SetIdentifier(bookUUID)
if item.FileSha256.Valid {
- entry.AddMetadata("bookmann:sha256", item.FileSha256.String)
+ entry.AddMetadata("bookhoard:sha256", item.FileSha256.String)
}
collections, err := h.db.GetCollectionsForBook(c.Request().Context(), pgtype.UUID{Bytes: item.ID.Bytes, Valid: true})
@@ -466,12 +466,12 @@ func (h *OPDSHandler) DownloadBook(c echo.Context) error {
filename := filepath.Base(filePath)
c.Response().Header().Set("Content-Type", mimeType)
c.Response().Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
- c.Response().Header().Set("X-Bookmann-UUID", bookUUID.String())
+ c.Response().Header().Set("X-Bookhoard-UUID", bookUUID.String())
if format == "kepub" && fileSha256 != "" {
- c.Response().Header().Set("X-Bookmann-KEPUB-SHA256", fileSha256)
+ c.Response().Header().Set("X-Bookhoard-KEPUB-SHA256", fileSha256)
} else if fileSha256 != "" {
- c.Response().Header().Set("X-Bookmann-SHA256", fileSha256)
+ c.Response().Header().Set("X-Bookhoard-SHA256", fileSha256)
}
// Stream file
@@ -595,7 +595,7 @@ func (h *OPDSHandler) GetDeviceNavigation(c echo.Context) error {
// Create OPDS navigation feed
feed := opds.NewFeed(
fmt.Sprintf("urn:uuid:%s", deviceID),
- "Bookmann Library Navigation",
+ "Bookhoard Library Navigation",
)
// Add feed links
diff --git a/internal/handlers/progress.go b/internal/handlers/progress.go
index a9b4c00..3526100 100644
--- a/internal/handlers/progress.go
+++ b/internal/handlers/progress.go
@@ -1,8 +1,8 @@
package handlers
import (
- "bookmann/internal/database"
- wsync "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ wsync "bookhoard/internal/sync"
"context"
"net/http"
"strconv"
diff --git a/internal/handlers/queue.go b/internal/handlers/queue.go
index a0cf6e2..5f121f4 100644
--- a/internal/handlers/queue.go
+++ b/internal/handlers/queue.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"net/http"
"strconv"
diff --git a/internal/handlers/refresh_token.go b/internal/handlers/refresh_token.go
index bd24a6c..d9da78d 100644
--- a/internal/handlers/refresh_token.go
+++ b/internal/handlers/refresh_token.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"net/http"
diff --git a/internal/handlers/sidecar.go b/internal/handlers/sidecar.go
index 05cb571..401067e 100644
--- a/internal/handlers/sidecar.go
+++ b/internal/handlers/sidecar.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"encoding/json"
"fmt"
"net/http"
@@ -22,7 +22,7 @@ func NewSidecarHandler(db *database.Queries) *SidecarHandler {
type SidecarConfig struct {
Version string `json:"version"`
- Bookmann SidecarBookmannConfig `json:"bookmann"`
+ Bookmann SidecarBookmannConfig `json:"bookhoard"`
Books map[string]SidecarBook `json:"books"`
Collections []SidecarCollection `json:"collections"`
OPDSEnabled bool `json:"opds_enabled"`
@@ -40,7 +40,7 @@ type SidecarBookmannConfig struct {
}
type SidecarBook struct {
- BookmannUUID string `json:"bookmann_uuid"`
+ BookhoardUUID string `json:"bookhoard_uuid"`
Title string `json:"title"`
Author string `json:"author"`
AvailableFormats []string `json:"available_formats"`
@@ -119,7 +119,7 @@ func (h *SidecarHandler) GetSidecarConfig(c echo.Context) error {
}
books[key] = SidecarBook{
- BookmannUUID: bookUUID,
+ BookhoardUUID: bookUUID,
Title: item.Title,
Author: author,
AvailableFormats: availableFormats,
@@ -254,7 +254,7 @@ func (h *SidecarHandler) DownloadSidecarConfig(c echo.Context) error {
}
books[key] = SidecarBook{
- BookmannUUID: bookUUID,
+ BookhoardUUID: bookUUID,
Title: item.Title,
Author: author,
AvailableFormats: availableFormats,
diff --git a/internal/handlers/sync.go b/internal/handlers/sync.go
index 18ea76c..8618dcb 100644
--- a/internal/handlers/sync.go
+++ b/internal/handlers/sync.go
@@ -1,7 +1,7 @@
package handlers
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"net/http"
"time"
diff --git a/internal/handlers/websocket.go b/internal/handlers/websocket.go
index 8cef571..b87f295 100644
--- a/internal/handlers/websocket.go
+++ b/internal/handlers/websocket.go
@@ -1,9 +1,9 @@
package handlers
import (
- "bookmann/internal/database"
- "bookmann/internal/middleware"
- "bookmann/internal/sync"
+ "bookhoard/internal/database"
+ "bookhoard/internal/middleware"
+ "bookhoard/internal/sync"
"context"
"log"
"net/http"
diff --git a/internal/middleware/device_auth.go b/internal/middleware/device_auth.go
index 5c6daed..3ac780b 100644
--- a/internal/middleware/device_auth.go
+++ b/internal/middleware/device_auth.go
@@ -1,7 +1,7 @@
package middleware
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"net/http"
"strings"
diff --git a/internal/middleware/request_tracing.go b/internal/middleware/request_tracing.go
index c6549fb..537a160 100644
--- a/internal/middleware/request_tracing.go
+++ b/internal/middleware/request_tracing.go
@@ -1,7 +1,7 @@
package middleware
import (
- "bookmann/internal/config"
+ "bookhoard/internal/config"
"bytes"
"encoding/json"
"io"
diff --git a/internal/opds/feed.go b/internal/opds/feed.go
index d0c1b37..3fbfe46 100644
--- a/internal/opds/feed.go
+++ b/internal/opds/feed.go
@@ -125,7 +125,7 @@ func (e *Entry) AddLink(href, linkType, rel string) {
// SetIdentifier sets the canonical identifier
func (e *Entry) SetIdentifier(id string) {
e.Identifier = &Identifier{
- ID: "bookmann",
+ ID: "bookhoard",
Content: id,
}
}
diff --git a/internal/opds/feed_test.go b/internal/opds/feed_test.go
index 9b2b052..70404b2 100644
--- a/internal/opds/feed_test.go
+++ b/internal/opds/feed_test.go
@@ -120,7 +120,7 @@ func TestEntrySetIdentifier(t *testing.T) {
t.Fatal("expected Identifier to be set, but it was nil")
}
- if entry.Identifier.ID != "bookmann" {
+ if entry.Identifier.ID != "bookhoard" {
t.Errorf("expected Identifier ID to be 'bookmann', got '%s'", entry.Identifier.ID)
}
@@ -131,14 +131,14 @@ func TestEntrySetIdentifier(t *testing.T) {
func TestEntryAddMetadata(t *testing.T) {
entry := NewEntry("urn:uuid:test-id", "Test Title", "Test Author", "2023-01-01T00:00:00Z")
- entry.AddMetadata("bookmann:sha256", "abc123...")
+ entry.AddMetadata("bookhoard:sha256", "abc123...")
if len(entry.Metadata) != 1 {
t.Fatalf("expected 1 metadata item, got %d", len(entry.Metadata))
}
meta := entry.Metadata[0]
- if meta.Property != "bookmann:sha256" {
+ if meta.Property != "bookhoard:sha256" {
t.Errorf("expected Property to be 'bookmann:sha256', got '%s'", meta.Property)
}
@@ -181,7 +181,7 @@ func TestFeedGenerateXML(t *testing.T) {
entry := NewEntry("urn:uuid:book-id", "Test Book", "Test Author", "2023-01-01T00:00:00Z")
entry.AddAcquisitionLink("http://example.com/book.epub", "application/epub+zip")
entry.SetIdentifier("book-uuid-123")
- entry.AddMetadata("bookmann:sha256", "abc123...")
+ entry.AddMetadata("bookhoard:sha256", "abc123...")
feed.AddEntry(entry)
output, err := feed.GenerateXML()
@@ -205,8 +205,8 @@ func TestFeedGenerateXML(t *testing.T) {
`Test Author`,
`book-uuid-123`,
- `abc123...`,
+ `book-uuid-123`,
+ `abc123...`,
}
for _, required := range requiredStrings {
diff --git a/internal/services/book_matching.go b/internal/services/book_matching.go
index 8c32646..30affc6 100644
--- a/internal/services/book_matching.go
+++ b/internal/services/book_matching.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"math"
@@ -13,7 +13,7 @@ import (
// BookMatch represents a potential match with confidence score
type BookMatch struct {
MediaItemID uuid.UUID `json:"media_item_id"`
- BookmannUUID uuid.UUID `json:"bookmann_uuid"`
+ BookhoardUUID uuid.UUID `json:"bookhoard_uuid"`
Confidence float64 `json:"confidence"`
MatchMethod string `json:"match_method"`
}
@@ -61,7 +61,7 @@ func (s *BookMatchingService) QueryBooks(ctx context.Context, req *BookQueryRequ
var matches []BookMatch
// Priority 1: Bookmann UUID (canonical) - Confidence: 1.0
- if match := s.matchByBookmannUUID(ctx, req.Identifiers); match != nil {
+ if match := s.matchByBookhoardUUID(ctx, req.Identifiers); match != nil {
matches = append(matches, *match)
}
@@ -113,8 +113,8 @@ func (s *BookMatchingService) QueryBooks(ctx context.Context, req *BookQueryRequ
}, nil
}
-// matchByBookmannUUID attempts to match by Bookmann UUID
-func (s *BookMatchingService) matchByBookmannUUID(ctx context.Context, identifiers []string) *BookMatch {
+// matchByBookhoardUUID attempts to match by Bookmann UUID
+func (s *BookMatchingService) matchByBookhoardUUID(ctx context.Context, identifiers []string) *BookMatch {
for _, id := range identifiers {
if len(id) > 4 && id[:4] == "uuid:" {
uuidStr := id[5:]
@@ -129,7 +129,7 @@ func (s *BookMatchingService) matchByBookmannUUID(ctx context.Context, identifie
mediaUUID := item.ID.Bytes
return &BookMatch{
MediaItemID: mediaUUID,
- BookmannUUID: mediaUUID,
+ BookhoardUUID: mediaUUID,
Confidence: 1.0,
MatchMethod: "uuid_match",
}
@@ -156,7 +156,7 @@ func (s *BookMatchingService) matchByOPFUUID(ctx context.Context, identifiers []
if item.OpfUuid.Valid && item.OpfUuid.String == uuidStr {
return &BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.95,
MatchMethod: "opf_uuid_match",
}
@@ -181,7 +181,7 @@ func (s *BookMatchingService) matchBySHA256(ctx context.Context, sha256 string)
if item.FileSha256.Valid && item.FileSha256.String == sha256 {
return &BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.9,
MatchMethod: "sha256_match",
}
@@ -207,7 +207,7 @@ func (s *BookMatchingService) matchByOPFIdentifier(ctx context.Context, identifi
if item.OpfIdentifier.Valid && item.OpfIdentifier.String == identifier {
return &BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.85,
MatchMethod: "opf_identifier_match",
}
@@ -235,7 +235,7 @@ func (s *BookMatchingService) matchByISBNASIN(ctx context.Context, identifiers [
if item.Isbn.Valid && item.Isbn.String == isbn {
return &BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.8,
MatchMethod: "isbn_match",
}
@@ -257,7 +257,7 @@ func (s *BookMatchingService) matchByISBNASIN(ctx context.Context, identifiers [
if item.Asin.Valid && item.Asin.String == asin {
return &BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.8,
MatchMethod: "asin_match",
}
@@ -293,7 +293,7 @@ func (s *BookMatchingService) matchByTitleAuthorSize(ctx context.Context, title,
if titleMatch && authorMatch && sizeMatch {
matches = append(matches, BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.5,
MatchMethod: "title_author_size_match",
})
@@ -319,7 +319,7 @@ func (s *BookMatchingService) matchByTitleOnly(ctx context.Context, title string
if item.Title == title {
matches = append(matches, BookMatch{
MediaItemID: item.ID.Bytes,
- BookmannUUID: item.ID.Bytes,
+ BookhoardUUID: item.ID.Bytes,
Confidence: 0.3,
MatchMethod: "title_match",
})
diff --git a/internal/services/collection_service.go b/internal/services/collection_service.go
index 1fba253..4588df5 100644
--- a/internal/services/collection_service.go
+++ b/internal/services/collection_service.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"encoding/json"
"fmt"
diff --git a/internal/services/collection_service_test.go b/internal/services/collection_service_test.go
index d137b31..65f46b1 100644
--- a/internal/services/collection_service_test.go
+++ b/internal/services/collection_service_test.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"testing"
"github.com/jackc/pgx/v5/pgtype"
diff --git a/internal/services/conversion_service.go b/internal/services/conversion_service.go
index 001abff..64300c2 100644
--- a/internal/services/conversion_service.go
+++ b/internal/services/conversion_service.go
@@ -11,7 +11,7 @@ import (
"path/filepath"
"time"
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"github.com/jackc/pgx/v5/pgtype"
)
diff --git a/internal/services/ebook_scanner.go b/internal/services/ebook_scanner.go
index d6e7167..8a3bfe2 100644
--- a/internal/services/ebook_scanner.go
+++ b/internal/services/ebook_scanner.go
@@ -1,8 +1,8 @@
package services
import (
- "bookmann/internal/database"
- "bookmann/internal/utils"
+ "bookhoard/internal/database"
+ "bookhoard/internal/utils"
"context"
"crypto/sha256"
"encoding/hex"
diff --git a/internal/services/library_service.go b/internal/services/library_service.go
index f84b0cc..d0ef440 100644
--- a/internal/services/library_service.go
+++ b/internal/services/library_service.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"path/filepath"
diff --git a/internal/services/scheduler.go b/internal/services/scheduler.go
index 043fe36..b60cc78 100644
--- a/internal/services/scheduler.go
+++ b/internal/services/scheduler.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"log"
diff --git a/internal/services/worker.go b/internal/services/worker.go
index 2f14a3c..d4829c2 100644
--- a/internal/services/worker.go
+++ b/internal/services/worker.go
@@ -1,7 +1,7 @@
package services
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"fmt"
"sync"
diff --git a/internal/sync/offline.go b/internal/sync/offline.go
index 674b38f..5f6ccaa 100644
--- a/internal/sync/offline.go
+++ b/internal/sync/offline.go
@@ -1,7 +1,7 @@
package sync
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"log"
"time"
diff --git a/internal/sync/offline_test.go b/internal/sync/offline_test.go
index 7e42a04..286ee62 100644
--- a/internal/sync/offline_test.go
+++ b/internal/sync/offline_test.go
@@ -1,7 +1,7 @@
package sync
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"testing"
"time"
diff --git a/internal/sync/queue.go b/internal/sync/queue.go
index 981a9d8..08548d7 100644
--- a/internal/sync/queue.go
+++ b/internal/sync/queue.go
@@ -1,7 +1,7 @@
package sync
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"encoding/json"
"fmt"
diff --git a/internal/sync/queue_test.go b/internal/sync/queue_test.go
index c2fc4bc..cfec5bb 100644
--- a/internal/sync/queue_test.go
+++ b/internal/sync/queue_test.go
@@ -1,7 +1,7 @@
package sync
import (
- "bookmann/internal/database"
+ "bookhoard/internal/database"
"context"
"encoding/json"
"testing"