Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make workflow of uploader configurable via upload.workflow #1268

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading