Skip to content

Cache generated thumbnails per topic #7

Description

@alimaandev

Problem

The pipeline (shortube/pipeline.py) regenerates the thumbnail on every run, even when the script/title/hook haven't changed (e.g. a resumed render). This wastes a Pillow render and disk writes.

Task

Skip thumbnail generation when a valid thumbnail.jpg already exists for the topic's output dir and the source inputs (script.title/script.hook) match the cached generation.

Acceptance criteria

  • Re-running a finished video's pipeline does not regenerate the thumbnail
  • Changing the title/hook triggers a fresh thumbnail
  • Unit test in tests/test_pipeline.py (mock generate_thumbnail and assert call count)

Files

  • shortube/pipeline.py
  • tests/test_pipeline.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions