Final cleanup: Update remaining comments and variable names
Changes: - Update comments: "Bookmann UUID" → "Bookhoard UUID" - Rename sidecar struct field: Bookmann → Bookhoard - Update type names: SidecarBookmannConfig → SidecarBookhoardConfig - Fix test database name in queue_test.go - Fix uppercase env var examples in KOBO_SETUP.md Internal Go variable names (BookmannUuid, bookmannUUID) left unchanged as they're implementation details that don't affect functionality. Part of project rename to Bookhoard.
This commit is contained in:
@@ -25,13 +25,13 @@ func NewKoboHandler(db *database.Queries, connManager *wsync.ConnectionManager)
|
||||
return &KoboHandler{db: db, connManager: connManager}
|
||||
}
|
||||
|
||||
// mapContentIdToBookhoardUUID maps Kobo ContentId to Bookmann UUID with multiple fallback strategies
|
||||
// mapContentIdToBookhoardUUID maps Kobo ContentId to Bookhoard UUID with multiple fallback strategies
|
||||
// Phase 6: Enhanced Kobo Sync - ContentId Mapping Logic
|
||||
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 {
|
||||
// Found! Use canonical Bookmann UUID
|
||||
// Found! Use canonical Bookhoard UUID
|
||||
return uuid.UUID(catalog.BookmannUuid.Bytes), nil, "catalog_match"
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func (h *KoboHandler) mapContentIdToBookhoardUUID(ctx echo.Context, contentId st
|
||||
return uuid.Nil, fmt.Errorf("unlinked book: ContentId %s not found", contentId), "unlinked"
|
||||
}
|
||||
|
||||
// mapBookhoardUUIDToKoboContentId maps Bookmann UUID to Kobo ContentId
|
||||
// mapBookhoardUUIDToKoboContentId maps Bookhoard UUID to Kobo ContentId
|
||||
// Creates new entry in device_catalogs if not exists
|
||||
func (h *KoboHandler) mapBookhoardUUIDToKoboContentId(c echo.Context, bookmannUUID uuid.UUID, deviceID uuid.UUID) (string, error) {
|
||||
// Check if catalog entry already exists
|
||||
|
||||
@@ -22,7 +22,7 @@ func NewSidecarHandler(db *database.Queries) *SidecarHandler {
|
||||
|
||||
type SidecarConfig struct {
|
||||
Version string `json:"version"`
|
||||
Bookmann SidecarBookmannConfig `json:"bookhoard"`
|
||||
Bookhoard SidecarBookhoardConfig `json:"bookhoard"`
|
||||
Books map[string]SidecarBook `json:"books"`
|
||||
Collections []SidecarCollection `json:"collections"`
|
||||
OPDSEnabled bool `json:"opds_enabled"`
|
||||
@@ -30,7 +30,7 @@ type SidecarConfig struct {
|
||||
LastUpdated string `json:"last_updated"`
|
||||
}
|
||||
|
||||
type SidecarBookmannConfig struct {
|
||||
type SidecarBookhoardConfig struct {
|
||||
OPDSCatalog string `json:"opds_catalog"`
|
||||
SyncAPI string `json:"sync_api"`
|
||||
OPDSBaseURL string `json:"opds_base_url"`
|
||||
@@ -40,7 +40,7 @@ type SidecarBookmannConfig struct {
|
||||
}
|
||||
|
||||
type SidecarBook struct {
|
||||
BookhoardUUID string `json:"bookhoard_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{
|
||||
BookhoardUUID: bookUUID,
|
||||
BookhoardUUID: bookUUID,
|
||||
Title: item.Title,
|
||||
Author: author,
|
||||
AvailableFormats: availableFormats,
|
||||
@@ -169,7 +169,7 @@ func (h *SidecarHandler) GetSidecarConfig(c echo.Context) error {
|
||||
// Build sidecar config
|
||||
config := SidecarConfig{
|
||||
Version: "1.0",
|
||||
Bookmann: SidecarBookmannConfig{
|
||||
Bookhoard: SidecarBookhoardConfig{
|
||||
OPDSCatalog: opdsCatalogURL,
|
||||
SyncAPI: syncAPIURL,
|
||||
OPDSBaseURL: opdsBaseURL.Value,
|
||||
@@ -254,7 +254,7 @@ func (h *SidecarHandler) DownloadSidecarConfig(c echo.Context) error {
|
||||
}
|
||||
|
||||
books[key] = SidecarBook{
|
||||
BookhoardUUID: bookUUID,
|
||||
BookhoardUUID: bookUUID,
|
||||
Title: item.Title,
|
||||
Author: author,
|
||||
AvailableFormats: availableFormats,
|
||||
@@ -300,7 +300,7 @@ func (h *SidecarHandler) DownloadSidecarConfig(c echo.Context) error {
|
||||
|
||||
sidecarConfig = SidecarConfig{
|
||||
Version: "1.0",
|
||||
Bookmann: SidecarBookmannConfig{
|
||||
Bookhoard: SidecarBookhoardConfig{
|
||||
OPDSCatalog: opdsCatalogURL,
|
||||
SyncAPI: syncAPIURL,
|
||||
OPDSBaseURL: opdsBaseURL.Value,
|
||||
|
||||
Reference in New Issue
Block a user