summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xvideorm.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/videorm.pl b/videorm.pl
index 4622cf0..c612410 100755
--- a/videorm.pl
+++ b/videorm.pl
@@ -180,12 +180,15 @@ my $res = $dbh->selectall_arrayref ( "SELECT id FROM $config{prefix}videodata WH
die "Error: Your collection is not sane! (and `--force' is not set).\n"
unless ( (-l $file_s and (defined ($file_d) and -f $file_d) and $#$res == 0)
or (defined $force) );
+my $id = $res->[0]->[0];
my $r = 0;
&ack ( "Updating database... ",
- $dbh->do ( "DELETE FROM $config{prefix}videodata WHERE filename = ?", undef, $file ) > 0);
+ $dbh->do ( "DELETE FROM $config{prefix}videodata WHERE id = ?", undef, $id ) > 0 &&
+ $dbh->do ( "DELETE FROM $config{prefix}videogenre WHERE video_id = ?", undef, $id ) > 0 &&
+ $dbh->do ( "DELETE FROM $config{prefix}userseen WHERE video_id = ?", undef, $id ) > 0 );
&ack ( "Deleting symlink... ",
-l $file_s && unlink $file_s );