Skip to content

Feature request: Native scheduled playlist refresh (cron-style auto-regeneration) #22

Description

@vinhdat-nguyen

Problem
MediaSage playlists are static once generated — there's no way to have a playlist automatically regenerate on a recurring basis. The library cache already has a similar concept (auto-refresh if >24h stale), but nothing analogous exists for playlists themselves. Right now, the only way to get a "refresh every 24h" playlist is to script around the existing /api/generate/stream SSE endpoint externally (e.g., PowerShell + Task Scheduler, cron + curl), which means re-supplying the original prompt/filters every time and has no visibility inside the app.
Proposed feature
Add native scheduling so a saved playlist can be tied to its original generation parameters (prompt, filters, track count, provider settings) and regenerated automatically on an interval, using the same replace mode already supported by /api/playlist/update.
Rough shape:

A schedule field on saved playlists (e.g., daily, weekly, or a cron expression), configurable from the UI where the playlist is created/edited
A lightweight in-process scheduler (e.g., APScheduler, already common in FastAPI apps) that re-runs generation with the stored parameters and replaces the existing playlist in Plex
Persisted schedule state in the existing SQLite store, so it survives restarts
Footer/status indicator similar to the library sync status, showing next scheduled refresh and last run result
New/extended API endpoints, e.g. GET/POST /api/playlist/schedule, so this is also scriptable for people who'd rather not use the UI

Why this fits MediaSage
The filter-first, library-aware generation is exactly what makes "refresh on a timer" useful here — regenerating pulls from the same guaranteed-playable pool rather than drifting toward tracks you don't own. This would remove the need for users to hand-roll external SSE polling scripts for something that feels like a core feature (e.g., a "Daily Discovery" or mood playlist that should stay fresh).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions