get(); $dupecount = 0; $counter = 1; $timer = TIME(); if (isset($argv[1]) && $argv[1]=="full") $resrel = $db->exec(sprintf("SELECT ID, guid FROM releases GROUP BY GID HAVING COUNT(GID) > 1")); elseif (isset($argv[1]) && is_numeric($argv[1])) $resrel = $db->prepare(sprintf("SELECT ID, guid FROM releases WHERE adddate > (NOW() - INTERVAL %d HOUR) GROUP BY GID HAVING COUNT(GID) > 1", $argv[1])); $resrel->execute(); $total = $resrel->rowCount(); if($total > 0) { foreach ($resrel as $rowrel) { $functions->fastDelete($rowrel['ID'], $rowrel['guid'], $site); $dupecount ++; $consoletools->overWrite("Removed: [".$dupecount."] ".$consoletools->percentString($counter++,$total)); } } if ($total > 0) { echo "\n"."Query took ".(TIME() - $timer)." seconds.\n"; echo "Removed ".number_format($dupecount)." crossposted releases.\n"; } else { echo "\n"."Query took ".(TIME() - $timer)." seconds.\n"; echo "There were no crossposted releases for removal"."\n"; } }