Skip to content

Commit

Permalink
Make workflow of uploader configurable via upload.workflow (#1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 authored Nov 4, 2024
2 parents d252b97 + 0a74e01 commit b5c2244
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/src/config/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ pub(crate) struct UploadConfig {
/// Whether specifying a series is required when uploading.
#[config(default = false)]
pub require_series: bool,

/// Specify workflow to start after ingesting. If unset, Tobira does not
/// send any workflow ID, meaning Opencast will choose its default.
pub workflow: Option<String>,
}
1 change: 1 addition & 0 deletions backend/src/http/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ fn frontend_config(config: &Config) -> serde_json::Value {
},
"upload": {
"requireSeries": config.upload.require_series,
"workflow": config.upload.workflow,
},
"siteTitle": config.general.site_title,
"initialConsent": config.general.initial_consent,
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/setup/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@
# Default value: false
#require_series = false

# Specify workflow to start after ingesting. If unset, Tobira does not
# send any workflow ID, meaning Opencast will choose its default.
#workflow =


# Matomo integration (optional). Currently only used by Paella if configured.
[matomo]
Expand Down
1 change: 1 addition & 0 deletions frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ type VersionInfo = {

type UploadConfig = {
requireSeries: boolean;
workflow: string | null;
};

type SyncConfig = {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/routes/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,9 @@ const finishUpload = async (
{
const body = new FormData();
body.append("mediaPackage", mediaPackage);
if (CONFIG.upload.workflow) {
body.append("workflowDefinitionId", CONFIG.upload.workflow);
}
await ocRequest("/ingest/ingest", { method: "post", body: body });
}

Expand Down

0 comments on commit b5c2244

Please sign in to comment.