diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-18 12:18:30 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-18 12:18:30 +0100 |
commit | 9e6435fa81a64f11e9b50c704d367cd9e135235b (patch) | |
tree | c8a6f22b2956ee4a41f50d8ed33c3c0ad4387306 | |
parent | ffbe78bc5d9000a5e62ca01e4feb40bdad75d287 (diff) |
clean videogenre & userseen
-rwxr-xr-x | videorm.pl | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 ); |