Jobs queue and video transcode from the video page

Add an in-memory FIFO Job queue (wrolpi/jobs.py): functions register by
name, callers enqueue by name with JSON kwargs, and the perpetual-tasks
owner runs them one at a time.  Logging emitted inside a Job and the
output of its subprocesses are captured into a per-Job log; Jobs report
progress and can be cancelled (a running Job's subprocess is killed).
Jobs are not persisted; an API restart forgets them.

Add a transcode Job and POST /api/videos/<id>/transcode.  ffmpeg reports
progress via -progress pipe:1.  The existing FileGroup is pointed at the
new file before the refresh so tags and history survive a container
change.

Replace the video page Refresh button with an Edit dropdown (Refresh,
Transcode).  The Transcode modal pre-fills from the preferred codecs in
the Videos settings and shows the Job's progress, log tail and Cancel.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-09-14 18:19:51 -06:00
parent c2ffc9286e
commit e480a386d0
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
15 changed files with 1535 additions and 14 deletions

View file

@ -16,6 +16,7 @@ import {
IconStack,
MediaFilterToggle,
MediaGate,
Menu,
Message,
MultiSelect,
NumberInput,
@ -382,6 +383,25 @@ export function ThemeSamplePage() {
</div>)}
</Row>
</div>
<div style={{marginTop: 12}}>
<Header as='h5'>A dropdown of actions</Header>
{/* The video page's Edit button: one labelled button opens a menu of the
rarer actions, so the row stays short. The trailing chevron is what
says "menu" rather than "does the thing"; a disabled item stays listed
so the user learns it exists. */}
<Row>
<Menu position='bottom-start' withinPortal>
<Menu.Target>
<Button role='primary' icon='edit' iconAfter='dropdown'>Edit</Button>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item leftSection={<Icon name='refresh'/>}>Refresh</Menu.Item>
<Menu.Item leftSection={<Icon name='film'/>}>Transcode...</Menu.Item>
<Menu.Item leftSection={<Icon name='trash'/>} disabled>Unavailable</Menu.Item>
</Menu.Dropdown>
</Menu>
</Row>
</div>
<div style={{marginTop: 12}}>
<Header as='h5'>A row of actions</Header>
{/* `.wrolpi-button-row` is how a page lists the actions on a thing -- the