refactor: remove Phase X terminology from source code comments

Remove planning document phase references from code comments:

app_test.go:
- Remove Phase 5 references from 8 test function comments

querier.go & queries.sql.go:
- Remove Phase 1, 2, 3, 4, 6 references from section headers
- Clean up week numbers (Weeks 5-6, Week 3-4, etc.)

queries.sql:
- Remove Phase 4 references from Kobo queries

kobo.go:
- Remove Phase 6 references from ContentId mapping comments

progress.go:
- Remove Phase 1 reference from route comment

media_scanner.go & media_scanner_library_type_test.go:
- Remove Phase 2 references from library type scanning comments

schema.sql:
- Remove Phase 1, 2, 3, 4, 5, 7 references from table/section comments
- Clean up: Format Detection, Progress Tracking, Device Registry,
  Sync Queue, Conflict Resolution, Reading History, Indexes, etc.

test_helpers.go:
- Remove Phase 6 reference from handler setup comment

These phase numbers were from internal planning documents and have no
meaning in the codebase. Removing them makes the code self-documenting.
This commit is contained in:
2026-02-13 21:50:29 -05:00
parent 80dcdfdd71
commit 2706ae52c1
9 changed files with 96 additions and 96 deletions
+8 -8
View File
@@ -27,7 +27,7 @@ func NewKoboHandler(db *database.Queries, connManager *wsync.ConnectionManager)
}
// mapContentIdToBookhoardUUID maps Kobo ContentId to Bookhoard UUID with multiple fallback strategies
// Phase 6: Enhanced Kobo Sync - ContentId Mapping Logic
// 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)
@@ -320,7 +320,7 @@ func (h *KoboHandler) Initialization(c echo.Context) error {
author = item.Author.String
}
// Phase 6: Use ContentId mapping instead of direct UUID
// Use ContentId mapping instead of direct UUID
koboContentId, err := h.mapBookhoardUUIDToKoboContentId(c, bookhoardUUID, deviceUUID)
if err != nil {
// Fallback to entitlement_id or generate new one
@@ -351,7 +351,7 @@ func (h *KoboHandler) Initialization(c echo.Context) error {
contentType = "5"
}
// Phase 6: Get collection metadata for this book
// Get collection metadata for this book
collections, _ := h.getCollectionMetadataForBook(c, bookhoardUUID, deviceUUID)
librarySync = append(librarySync, KoboLibraryBook{
@@ -403,7 +403,7 @@ func (h *KoboHandler) Markup(c echo.Context) error {
unlinkedBooks := 0
for _, readingSync := range req.ReadingSync {
// Phase 6: Use ContentId mapping with fallback logic
// Use ContentId mapping with fallback logic
bookhoardUUID, err, _ := h.mapContentIdToBookhoardUUID(c, readingSync.ContentId, deviceUUID)
if err != nil || bookhoardUUID == uuid.Nil {
// Unlinked book detected
@@ -440,7 +440,7 @@ func (h *KoboHandler) Markup(c echo.Context) error {
}
for _, bookmarkSync := range req.BookmarkSync {
// Phase 6: Use ContentId mapping with fallback logic
// Use ContentId mapping with fallback logic
bookhoardUUID, err, _ := h.mapContentIdToBookhoardUUID(c, bookmarkSync.ContentId, deviceUUID)
if err != nil || bookhoardUUID == uuid.Nil {
// Unlinked book - skip
@@ -541,7 +541,7 @@ func (h *KoboHandler) Bookmark(c echo.Context) error {
bookmarksSynced := 0
for _, bookmarkSync := range req.BookmarkSync {
// Phase 6: Use ContentId mapping with fallback logic
// Use ContentId mapping with fallback logic
bookhoardUUID, err, _ := h.mapContentIdToBookhoardUUID(c, bookmarkSync.ContentId, deviceUUID)
if err != nil || bookhoardUUID == uuid.Nil {
// Unlinked book - skip
@@ -606,7 +606,7 @@ func (h *KoboHandler) AnalyticsGettests(c echo.Context) error {
}
for _, test := range req {
// Phase 6: Use ContentId mapping with fallback logic
// Use ContentId mapping with fallback logic
bookhoardUUID, err, _ := h.mapContentIdToBookhoardUUID(c, test.ContentId, deviceUUID)
if err != nil || bookhoardUUID == uuid.Nil {
// Unlinked book - skip
@@ -683,7 +683,7 @@ func (h *KoboHandler) SyncFromServer(c echo.Context) error {
highlightsSent := 0
for _, syncData := range req {
// Phase 6: Use ContentId mapping with fallback logic
// Use ContentId mapping with fallback logic
bookhoardUUID, err, _ := h.mapContentIdToBookhoardUUID(c, syncData.ContentId, deviceUUID)
if err != nil || bookhoardUUID == uuid.Nil {
// Unlinked book - skip