api: Add script to queue all tracks for reprocessing, useful after algorithm changes
This commit is contained in:
parent
67b6341f68
commit
07ec5b40a0
19
api/tools/reprocess_all_tracks.js
Normal file
19
api/tools/reprocess_all_tracks.js
Normal file
|
@ -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);
|
||||
});
|
Loading…
Reference in a new issue