Skip to content

Commit 3ef4461

Browse files
committed
Add playlist bundle export and import
1 parent 6c11539 commit 3ef4461

37 files changed

Lines changed: 1512 additions & 26 deletions

‎components.lock.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"state": "resolved",
44
"cli": {
55
"repository": "screenrig/cli",
6-
"commit": "4a12fd97523db2243d5339a5783a2a86d96e66e5",
6+
"commit": "0c24e0e026697189f5566eb0c6eb85d5b14bc95e",
77
"artifact": {
88
"file": "screenrig-cli.tgz",
9-
"sha256": "bd9a0734a24fd80dc92ca45a61d5265f5dc2b9e316b436f1cfe889401a37d608"
9+
"sha256": "1439a76e7ca018fb6c4181ded8cb3a8b2512afbbff2ea6f2b26c3040a9a0a939"
1010
}
1111
}
1212
}

‎plugins/screenrig/cli/README.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,40 @@ Two rules decide whether a playlist is accepted:
270270
before they send anything, and name the screen and the command that fixes it.
271271
Set the zone first, then assign.
272272

273+
## Playlist bundles
274+
275+
Export one playlist and the exact original renditions it currently resolves:
276+
277+
```sh
278+
screenrig --json playlist export pl_01 --output ./lobby-bundle
279+
```
280+
281+
The destination must not exist. Export writes a private
282+
`screenrig.playlist-bundle/v1` directory through a temporary sibling and then
283+
renames it into place. The bundle contains `screenrig-bundle.json`,
284+
`playlist.json`, and content-addressed `media/<sha256>.<canonical-ext>` files.
285+
The manifest records `selector_policy: "snapshot"` and
286+
`comments_policy: "excluded"`. Dynamic `all` and `tag` selectors become exact
287+
`id` or `ids` snapshots. Iframes remain URLs. Application placements are
288+
rejected before any media download because v1 has no application-package
289+
export.
290+
291+
Import creates a new playlist by default. Updating is explicit and requires the
292+
current destination revision:
293+
294+
```sh
295+
screenrig --json playlist import ./lobby-bundle
296+
screenrig --json playlist import ./lobby-bundle --update pl_02 --if-match 8
297+
```
298+
299+
Import validates the complete local bundle before it starts a remote mutation.
300+
It lists existing media, reuses exact filename/MIME/size/SHA-256/tag matches with
301+
an injective source-to-destination mapping, and uploads remaining media serially
302+
without transcoding. The playlist write happens only after every media object is
303+
ready. Import never deletes or prunes remote media. If a later step fails after
304+
an upload starts, the error reports partial mutation and states that no cleanup
305+
was attempted; retrying the same bundle reuses exact ready media.
306+
273307
## Screen toast
274308

275309
A toast is transient stage chrome on one screen, not a placement. It occupies

‎plugins/screenrig/cli/dist/argv.d.ts.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/cli/dist/argv.js‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/cli/dist/argv.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/cli/dist/client.d.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Transport, TransportRequest, TransportResponse } from "./transport/types.js";
1+
import type { Transport, TransportDownloadResponse, TransportRequest, TransportResponse } from "./transport/types.js";
22
import type { Operation } from "./adapters/protocol.js";
33
export interface ApiClientOptions {
44
transport: Transport;
@@ -23,6 +23,9 @@ export declare class ApiClient {
2323
idempotent?: boolean;
2424
idempotencyKey?: string;
2525
}): Promise<TransportResponse>;
26+
download(req: Omit<TransportRequest, "headers"> & {
27+
headers?: Record<string, string>;
28+
}): Promise<TransportDownloadResponse>;
2629
getOperation(id: string): Promise<Operation>;
2730
waitForOperation(id: string, options: {
2831
timeoutMs: number;

‎plugins/screenrig/cli/dist/client.d.ts.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/cli/dist/client.js‎

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)