From 07ec5b40a097786f2cfcf41790e302d8c7825f6b Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Sun, 31 Oct 2021 21:35:33 +0100 Subject: [PATCH] api: Add script to queue all tracks for reprocessing, useful after algorithm changes --- api/tools/reprocess_all_tracks.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 api/tools/reprocess_all_tracks.js diff --git a/api/tools/reprocess_all_tracks.js b/api/tools/reprocess_all_tracks.js new file mode 100644 index 0000000..b26af52 --- /dev/null +++ b/api/tools/reprocess_all_tracks.js @@ -0,0 +1,19 @@ +require('../src/db'); + +const { Track } = require('../src/models'); + +async function main() { + for (const track of await Track.find()) { + console.log('queuing', track.slug); + await track.queueProcessing(); + } +} + +main() + .then(() => { + process.exit(1); + }) + .catch((e) => { + console.error(e); + process.exit(1); + });