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
+14 -14
View File
@@ -16,7 +16,7 @@ SELECT id, email, username, theme, first_name, last_name, role, created_at, upda
SELECT id, email, username, password_hash, theme, first_name, last_name, role, created_at, updated_at FROM users WHERE email = $1 OR username = $1;
-- name: GetUser :one
SELECT
SELECT
u.id,
u.email,
u.username,
@@ -35,7 +35,7 @@ WHERE u.id = $1;
SELECT password_hash FROM users WHERE id = $1;
-- name: ListUsers :many
SELECT
SELECT
u.id,
u.email,
u.username,
@@ -520,7 +520,7 @@ UPDATE refresh_tokens SET revoked_at = NOW() WHERE user_id = $1 AND revoked_at I
DELETE FROM refresh_tokens WHERE expires_at < NOW() OR (revoked_at IS NOT NULL AND revoked_at < NOW() - INTERVAL '7 days');
-- ============================================
-- PHASE 1: FORMAT DETECTION & PROGRESS (Week 2)
-- FORMAT DETECTION & PROGRESS
-- ============================================
-- Update media item format group information
@@ -716,7 +716,7 @@ SELECT
LIMIT $2;
-- ============================================
-- PHASE 2: DEVICE MANAGEMENT & AUTH (Weeks 5-6)
-- DEVICE MANAGEMENT & AUTH
-- ============================================
-- Device Registration & Management
@@ -837,7 +837,7 @@ ORDER BY priority ASC, created_at ASC;
UPDATE sync_queue
SET
attempts = attempts + 1,
status = CASE
status = CASE
WHEN attempts + 1 >= max_attempts THEN 'failed'
ELSE 'pending'
END,
@@ -856,7 +856,7 @@ FROM sync_queue
WHERE device_id = $1;
-- name: ListAllSyncQueueItems :many
SELECT
SELECT
sq.*,
d.device_name,
d.device_type,
@@ -870,8 +870,8 @@ ORDER BY sq.priority ASC, sq.created_at DESC
LIMIT $1 OFFSET $2;
-- name: GetNextRetryTime :one
SELECT
CASE
SELECT
CASE
WHEN attempts = 0 THEN NOW()
WHEN attempts = 1 THEN NOW() + INTERVAL '1 minute'
WHEN attempts = 2 THEN NOW() + INTERVAL '5 minutes'
@@ -929,7 +929,7 @@ DELETE FROM sync_conflicts WHERE id = $1;
ORDER BY sc.created_at DESC;
-- ============================================
-- PHASE 3: KOREADER SYNC PROTOCOL (Weeks 7-9)
-- KOREADER SYNC PROTOCOL
-- ============================================
-- name: GetMediaItemByFilePathForSync :one
@@ -1040,7 +1040,7 @@ WHERE media_item_id = $1
AND last_sync_source != $3;
-- ============================================
-- KOBO SHELF MANAGEMENT QUERIES (Phase 4)
-- KOBO SHELF MANAGEMENT QUERIES
-- ============================================
-- name: AddBookToKoboShelf :one
@@ -1093,7 +1093,7 @@ FROM kobo_shelves
WHERE device_id = $1;
-- ============================================
-- KOBO ENTITLEMENT QUERIES (Phase 4)
-- KOBO ENTITLEMENT QUERIES
-- ============================================
-- name: CreateOrUpdateKoboEntitlement :one
@@ -1161,7 +1161,7 @@ SELECT * FROM media_items WHERE kobo_content_id = $1;
-- Media Items Admin Operations
-- ============================================
-- PHASE 1: UNIVERSAL BOOK IDENTIFIERS (Week 1)
-- UNIVERSAL BOOK IDENTIFIERS
-- ============================================
-- Update media item with universal identifiers
@@ -1522,7 +1522,7 @@ WHERE ks.device_id = $1 AND ks.collection_id = $2
ORDER BY ks.position_in_collection ASC, ks.shelf_position ASC;
-- ============================================
-- PHASE 6: ENHANCED KOBO SYNC (Week 3-4)
-- ENHANCED KOBO SYNC
-- ============================================
-- Create unlinked book entry
@@ -1587,4 +1587,4 @@ FROM unlinked_books ub
JOIN devices d ON ub.device_id = d.id
WHERE ub.resolved = false
ORDER BY ub.last_seen_at DESC
LIMIT $1 OFFSET $2;
LIMIT $1 OFFSET $2;