summaryrefslogtreecommitdiffstats
path: root/videomv.pl
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-17 22:57:13 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-17 22:57:13 +0100
commit0129cd78f1516df6d2af2a2eb81b58a039bfb1b5 (patch)
treed6c538db4ddd8fdea0fcbed9efa2fcc18ea4e2ae /videomv.pl
parentf8a039e6e65acc809b353f90d76c023e277de84e (diff)
prefix
Diffstat (limited to 'videomv.pl')
-rwxr-xr-xvideomv.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/videomv.pl b/videomv.pl
index ddc3357..063ecb3 100755
--- a/videomv.pl
+++ b/videomv.pl
@@ -29,7 +29,8 @@ my %config = do $confile;
die "Error in `" .$confile. "'\n" if $@ || not %config;
map { exists $config{$_} || die "Error: Missing `${_}'.\n" }
- qw /videodir driver database hostname user port password videodata/;
+ qw /videodir driver database hostname user port password/;
+$config{prefix} = "" unless exists $config{prefix};
my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder
die "Error: No such directory: `" .$symlinks. "'.\n" unless -d $symlinks;
@@ -310,7 +311,7 @@ e.g.,
user => 'username',
port => 3306,
password => '******',
- videodata => "videodb_videodata",
+ prefix => "videodb_",
=head1 EXIT STATUS
@@ -391,7 +392,7 @@ unless (defined $ignoredb_flag) {
# Lookup for the file in the videodb database
$RES =
- $dbh->selectall_hashref ( "SELECT id,director,title FROM $config{videodata}
+ $dbh->selectall_hashref ( "SELECT id,director,title FROM $config{prefix}videodata
WHERE filename = ?",
'id', undef, $old_filename
)
@@ -574,7 +575,7 @@ unless ($r || defined ($ignoredb_flag) || $old_filename eq $new_filename) {
&revert(@actions);
}
else {
- my $rv = $dbh->do ( "UPDATE $config{videodata} SET filename = ? WHERE id = ?",
+ my $rv = $dbh->do ( "UPDATE $config{prefix}videodata SET filename = ? WHERE id = ?",
undef, $new_filename, $id
);
&ack (\$r, $rv);