summaryrefslogtreecommitdiffstats
path: root/videorm.pl
diff options
context:
space:
mode:
Diffstat (limited to 'videorm.pl')
-rwxr-xr-xvideorm.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/videorm.pl b/videorm.pl
index 04e1e03..b30744d 100755
--- a/videorm.pl
+++ b/videorm.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;
@@ -112,7 +113,7 @@ e.g.,
user => 'username',
port => 3306,
password => '******',
- videodata => "videodb_videodata",
+ prefix => "videodb_",
=head1 EXIT STATUS
@@ -172,7 +173,7 @@ $dbh->do( "set names utf8" ) or die;
# Lookup for the file in the videodb database
-my $res = $dbh->selectall_arrayref ( "SELECT id FROM $config{videodata} WHERE filename = ?",
+my $res = $dbh->selectall_arrayref ( "SELECT id FROM $config{prefix}videodata WHERE filename = ?",
undef, $file )
or die "Can't select: " .$dbh->errstr. "\n";
@@ -184,7 +185,7 @@ die "Error: Your collection is not sane! (and `--force' is not set).\n"
my $r = 0;
&ack ( "Updating database... ",
- $dbh->do ( "DELETE FROM $config{videodata} WHERE filename = ?", undef, $file ) > 0);
+ $dbh->do ( "DELETE FROM $config{prefix}videodata WHERE filename = ?", undef, $file ) > 0);
&ack ( "Deleting symlink... ",
-l $file_s && unlink $file_s );