Updating to have type always

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-02 08:50:17 +01:00
parent af947d3fd2
commit e720776365
3 changed files with 48 additions and 29 deletions

15
server/apps/addtype.js Normal file
View File

@@ -0,0 +1,15 @@
path = require('path'),
pathThumbnails = __dirname;
db = require(pathThumbnails + '/../handlers/db.js');
db.getCollectionNames(function(err, docs) {
for(var i = 0; i < docs.length; i++) {
addType(docs[i]);
}
})
function addType(name) {
db.collection(name).update({duration: {$exists: true},type:{$ne:"suggested"}}, {$set: { type: "video" }}, {multi: true}, function(err, doc) {
process.exit();
});
}