summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 12:18:30 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 12:18:30 +0100
commit9e6435fa81a64f11e9b50c704d367cd9e135235b (patch)
treec8a6f22b2956ee4a41f50d8ed33c3c0ad4387306
parentffbe78bc5d9000a5e62ca01e4feb40bdad75d287 (diff)
clean videogenre & userseen
-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 );