diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-31 23:07:02 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-31 23:07:02 +0100 |
commit | c999a5247f868b4de1c64de30bcf9bde4a0ceeab (patch) | |
tree | 15265ad25232637f2893ca110aff0197d5b39112 | |
parent | 4484b8028cab08638f282426fceaf0d8da0a6ad2 (diff) |
typovideoadd
-rwxr-xr-x | videoadd.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/videoadd.pl b/videoadd.pl index eed8b86..add8f2a 100755 --- a/videoadd.pl +++ b/videoadd.pl @@ -140,7 +140,7 @@ if (defined $imdb{crit}) { elsif (defined $file) { # Fill in at least the title, based on the file name... $new{title} = basename ($file); - $new{title} =~ s/.(avi|ogm|ogg|bin|mpe?g|ra?m|mov|asf|wmv)$//; + $new{title} =~ s/.(avi|ogm|ogg|bin|mpe?g|ra?m|mov|asf|wmv|mkv)$//i; } @@ -209,21 +209,21 @@ unless ( defined $ignoredb_flag ) { my $INSERT = "INSERT INTO $config{videodata} SET mediatype = 14"; if (defined $new{filedate}) { - $INSERT .= ", FROM_UNIXTIME($new{filedate})"; + $INSERT .= ", filedate = FROM_UNIXTIME($new{filedate})"; delete $new{filedate}; } while (my ($k,$v) = each %new) { $INSERT .= ", " .$k. " = " .$dbh->quote ($v); } -# $dbh->do($INSERT) or die "Can't insert: $!\n"; - print $INSERT, "\n"; + $dbh->do($INSERT) or die "Can't insert: $!\n"; +# print $INSERT, "\n"; my $ids = $dbh->selectall_arrayref ( "SELECT id FROM $config{videodata} WHERE filename = ? ", undef, $new{filename} ); if ($#$ids == 0) { - print LOG "See the result there: ", + print LOG "Check it out! ", $config{url}, "/show.php?id=", $ids->[0]->[0], "\n" or die "Can't print: $!"; } |