feat(downloads): ad-hoc clips cut straight from a YouTube video or a Plex item
POST /api/downloads/clip takes a source (a YouTube id or a Plex rating key), a range of at most ten minutes and, for Plex, the audio track being heard. The clip becomes a per-user asset in the library like an editor clip, shareable as soon as it is ready. A YouTube clip fetches only its range (yt-dlp download_ranges: 3-7 s whatever the video's length); a Plex clip reads the library file in place. Both then go through one re-encode: frame-exact at the marks, H.264 at most 1080p with HDR tonemapped to SDR, stereo AAC, no chapter track, .mp4. Job kinds are a JobKind StrEnum now, and Re-download refuses every kind but a download.
This commit is contained in:
@@ -73,10 +73,17 @@ def test_every_path_to_ready_runs_the_rule():
|
||||
found.append(where)
|
||||
if not runs_rule:
|
||||
skipped.append(where)
|
||||
# The paths known today: a download, an editor clip, an upload's conversion, an upload kept as is.
|
||||
# The paths known today: a download, an editor clip, an ad-hoc clip, an upload's conversion, an
|
||||
# upload kept as is.
|
||||
# Fewer means the scan went blind (a rename, a new status spelling) — not that a path is gone.
|
||||
names = {w.rsplit(" ", 1)[1] for w in found}
|
||||
assert {"_download", "_process_edit", "_convert_upload", "ingest_upload"} <= names, found
|
||||
assert {
|
||||
"_download",
|
||||
"_process_edit",
|
||||
"_process_clip",
|
||||
"_convert_upload",
|
||||
"ingest_upload",
|
||||
} <= names, found
|
||||
assert skipped == [], f"marks an asset ready without the phone-safe rule: {skipped}"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user