Skip to content

Commit

Permalink
Allow uploads in the syncing state
Browse files Browse the repository at this point in the history
  • Loading branch information
yoe committed Feb 2, 2025
1 parent 28c018d commit f59921c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/SReview/Config/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ sub setup {
# Values for upload script
$config->define('upload_actions', 'An array of commands to run on each file to be uploaded. Each component is passed through Mojo::Template before processing. To avoid quoting issues, it is a two-dimensional array, so that no shell will be called to run this.', [['echo', '<%== $file %>', 'ready for upload']]);
$config->define('remove_actions', 'An array of commands to run on each file to be removed, when final review determines that the file needs to be reprocessed. Same format as upload_actions', [['echo', '<%== $file %>', 'ready for removal']]);
$config->define('sync_extensions', 'An array of extensions of files to sync');
$config->define('sync_actions', 'An array of commands to run on each file to be synced. Each component is passed through Mojo::Template before processing. To avoid quoting issues, it is a two-dimensional array, so that no shell will be called to run this.', [['echo', '<%== $file %>', 'ready for sync']]);
$config->define('cleanup', 'Whether to remove files after they have been published. Possible values: "all" (removes all files), "previews" (removes the output of sreview-cut, but not that of sreview-transcode), and "output" (removes the output of sreview-transcode, but not the output of sreview-cut). Other values will not remove files', 'none');

# for sreview-copy
$config->define('extra_collections', 'A hash of extra collection basenames. Can be used by sreview-copy.', undef);

Expand Down
14 changes: 12 additions & 2 deletions scripts/sreview-upload
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,18 @@ if($configprefix eq "upload" && ($config->get('cleanup') eq "all" || $config->ge
}
}

foreach my $profile(@{$config->get('output_profiles')}) {
my $basename = join('.', $talkdata->{slug}, Media::Convert::Asset::ProfileFactory->create($profile, $raw_file, $config->get('extra_profiles'))->exten());
my $exts = [];

if($configprefix ne "sync") {
foreach my $profile(@{$config->get('output_profiles')}) {
push @$exts, Media::Convert::Asset::ProfileFactory->create($profile, $raw_file, $config->get('extra_profiles'))->exten();
}
} else {
$exts = $config->get('sync_extensions');
}

foreach my $ext(@$exts) {
my $basename = join('.', $talkdata->{slug}, $ext);
my $file = $output_coll->get_file(relname => join('/', $reldir, $basename));
run_command($file->valid_path_filename, $file->relname, $file->basepath);
if($config->get('cleanup') eq "all" || $config->get('cleanup') eq 'output') {
Expand Down

0 comments on commit f59921c

Please sign in to comment.