Skip to content

feat: Auto-queue new releases into download queue #4

@SloppyTurtle

Description

@SloppyTurtle

Overview

When the scheduler detects a new release (issue #3), optionally
auto-queue it for download using Shelfmark's existing download queue
infrastructure. Depends on #1 and #3.

Goal

Allow users to configure per-author or global auto-queue behavior so
that new releases are automatically sent to the download queue without
manual intervention.

Implementation

Auto-Queue Logic

  • Runs after release detection in the scheduler job
  • Checks watchlist_auto_queue setting (global) and per-author override
  • If enabled, calls existing download queue logic for each pending release
  • Updates release status: pending > queued
  • On download completion: queued > downloaded
  • On failure: stays queued, retries next interval up to configurable max retries

Per-Author Auto-Queue Override
Add auto_queue column to watchlist_authors:

  • auto_queue TEXT - inherit, enabled, disabled. Default inherit (uses global setting)

Queue Integration

  • Hook into existing download queue, do not rewrite it
  • Use same source priority logic as manual queue
  • Respect existing format preferences
  • If no source found, leave as pending and retry next cycle

Failure Handling

  • No source found: stay pending, retry next cycle
  • Download fails: stay queued, increment retry count
  • Max retries reached: set status to failed, notify user
  • Source unreachable: skip, retry next cycle

New Settings

  • watchlist_auto_queue (default false) - Global auto-queue toggle
  • watchlist_max_retries (default 3) - Max download attempts per release
  • watchlist_preferred_format (default ebook) - Preferred format when both available

Acceptance Criteria

  • Auto-queue respects global setting
  • Auto-queue respects per-author override (inherit/enabled/disabled)
  • Release status transitions correctly (pending > queued > downloaded)
  • Failed downloads retry up to max retries
  • Releases with no source found stay pending and are retried
  • Existing download queue logic is not modified
  • Unit tests for status transition logic
  • Unit tests for per-author override behavior
  • No duplicate queue entries for the same release

Out of Scope

Depends On

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