diff --git a/scripts/regen-filelists.php b/scripts/regen-filelists.php new file mode 100644 index 000000000..699025e82 --- /dev/null +++ b/scripts/regen-filelists.php @@ -0,0 +1,35 @@ +scalar("SELECT MAX(ID) FROM torrents"); +$id = 0; + +while ($id < $max) { + $id++; + $DB->prepared_query(" + SELECT ID + FROM torrents + WHERE ID >= ? + ORDER BY ID + LIMIT ? + ", $id, 1000); + $list = $DB->collect(0); + foreach ($list as $id) { + try { + $torMan->regenerateFilelist($id); + } catch (RuntimeException $e) { + echo "$id: fail: " . $e->getMessage() . "\n"; + } + } +}