use strict;
use warnings FATAL => 'all';
+use App::IdiotBox::Common qw(@SupportedFormats);
use Cwd;
use IO::All;
use ExtUtils::MakeMaker qw(prompt);
use File::Spec::Functions qw(catfile catdir);
use POSIX qw(strftime);
+my $supported_formats_re = join('|', @SupportedFormats);
+
sub log_info (&) { print $_[0]->(), "\n"; }
sub run {
$info->{slug} = prompt('What is the slug for this talk?', $slug);
$info->{bucket} = $bucket;
$info->{announcement} = $ann;
+ $info->{announcement_id} = $ann->id; # Temp fix so INSERT behaves -- alh
$videos{$video_file} = bless($info, 'App::IdiotBox::Video');
}
foreach my $video_file (keys %videos) {
my ($class, $dir) = @_;
my %videos;
foreach my $file (io($dir)->all_files) {
- $file->filename =~ /^([^\.]+)\.([^\.]+)$/ or next;
+ $file->filename =~ /^([^\.]+)\.($supported_formats_re)$/ or next;
push(@{$videos{$1}||=[]}, $2);
}
\%videos;