Skip to content

feat: Add watchlist database schema and backend API #1

@SloppyTurtle

Description

@SloppyTurtle

Overview

This is the foundational issue for the monitoring feature. Before any
scheduling or release detection can be built, we need the data model
and API endpoints to support watchlists.

Goal

Add the ability for users to add authors and series to a watchlist that
will later be checked for new releases automatically.

Database Changes

Add two new tables via migration. Do not modify any existing tables.

watchlist_authors

  • id INTEGER - Primary key
  • user_id INTEGER - FK to existing users table
  • author_id TEXT - Provider author ID (Hardcover or Open Library)
  • author_name TEXT - Display name
  • provider TEXT - hardcover or openlibrary
  • added_at DATETIME
  • last_checked DATETIME - Nullable, updated by scheduler
  • enabled BOOLEAN - Default true, allows per-author pause

watchlist_releases

  • id INTEGER - Primary key
  • author_id INTEGER - FK to watchlist_authors
  • book_id TEXT - Provider book ID
  • title TEXT
  • release_date DATE - Nullable if unknown
  • format TEXT - ebook or audiobook
  • status TEXT - pending, queued, downloaded, ignored
  • detected_at DATETIME - When we first saw this release
  • queued_at DATETIME - Nullable

API Endpoints to Add

GET /api/watchlist
POST /api/watchlist
DELETE /api/watchlist/{id}
PATCH /api/watchlist/{id}
GET /api/watchlist/{id}/releases
PATCH /api/watchlist/releases/{id}

Acceptance Criteria

  • Migration creates both tables without affecting existing schema
  • All endpoints return appropriate HTTP status codes
  • All endpoints respect existing multi-user auth
  • Admin users can view all watchlists
  • Input validation on all POST/PATCH endpoints
  • Unit tests for all new endpoints
  • No changes to existing tables or endpoints

Out of Scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions