diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-19 04:26:11 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-19 04:26:11 +0000 |
commit | d45a743f64419e590a59cb1589abde773505c7d7 (patch) | |
tree | dfd10d245bcf7afc6a180a6203c9cf1ca44e3675 /bin | |
parent | 1c1ad6ef87a034ee6491844b1650cd6aa0cb3093 (diff) | |
download | ampache-d45a743f64419e590a59cb1589abde773505c7d7.tar.gz ampache-d45a743f64419e590a59cb1589abde773505c7d7.tar.bz2 ampache-d45a743f64419e590a59cb1589abde773505c7d7.zip |
improved quarantine a little more and updated to new getid3 some genre issues still unresolved
Diffstat (limited to 'bin')
-rw-r--r-- | bin/quarantine_migration.php.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/quarantine_migration.php.inc b/bin/quarantine_migration.php.inc index 8780c3a0..ee62fd47 100644 --- a/bin/quarantine_migration.php.inc +++ b/bin/quarantine_migration.php.inc @@ -30,6 +30,9 @@ init_preferences(); usage(); +/* Check if they want to force delete */ +$force_delete = $GLOBALS['argv']['1']; + // grab list of files from table $sql = "SELECT id, file, user,action FROM upload WHERE action != 'quarantine'"; $db_results = mysql_query($sql, dbh()); @@ -93,8 +96,13 @@ foreach ($files['add'] as $data) { } $results = unlink($data['file']); - if (!$results) { echo "Error: Unable to delete " . $data['file'] . "\n";} - + if (!$results AND !$force_delete) { echo "Error: Unable to delete " . $data['file'] . "\n";} + elseif (!$results) { + echo "Error: Unable to delete " . $data['file'] . "\n"; + echo "Force Delete enabled, removing from Database...\n"; + $sql = "DELETE FROM upload WHERE id='" . $data['id'] . "'"; + $db_results = mysql_query($sql, dbh()); + } // if not able to unlike else { echo _('Adding') . " " . $target_file . " " . _('to database') . "\n"; |