mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updated RESTApi to have tokens also
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
path = require('path'),
|
||||
pathThumbnails = __dirname;
|
||||
db = require(pathThumbnails + '/../handlers/db.js');
|
||||
var usual = [];
|
||||
var settings = [];
|
||||
|
||||
db.getCollectionNames(function(err, docs) {
|
||||
for(var i = 0; i < docs.length; i++) {
|
||||
addType(docs[i]);
|
||||
/*for(var i = 0; i < docs.length; i++) {
|
||||
if(docs[i].indexOf("_settings") > -1) {
|
||||
settings.push(docs[0]);
|
||||
} else {
|
||||
usual.push(docs[0]);
|
||||
}
|
||||
//addType(docs[i]);
|
||||
}
|
||||
for(var i = 0; i < usual.length; i++) {
|
||||
if(settings.indexOf(usual + "_settings") < 0) {
|
||||
console.log(usual);
|
||||
}
|
||||
}*/
|
||||
})
|
||||
|
||||
function addType(name) {
|
||||
db.collection(name).update({duration: {$exists: true},type:{$ne:"suggested"}}, {$set: { type: "video" }}, {multi: true}, function(err, doc) {
|
||||
process.exit();
|
||||
});
|
||||
if(name.indexOf("_settings") > -1) {
|
||||
db.collection(name).update({views: {$exists: true}}, {$set: { id: "config" }}, {multi: true}, function(err, doc) {
|
||||
console.log(name);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user