From 9e6435fa81a64f11e9b50c704d367cd9e135235b Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 18 Feb 2012 12:18:30 +0100 Subject: clean videogenre & userseen --- videorm.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); -- cgit v1.2.3