v2 up ioago94it0a
This commit is contained in:
@@ -1055,37 +1055,33 @@ class AutomaticDispose {
|
||||
done: 'false'
|
||||
}).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).limit(1)
|
||||
}).toArray()
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
// console.table(Wunsch);
|
||||
if (Wunsch !== undefined) {
|
||||
return Wunsch.count(function (count) {
|
||||
if (count > 0) {
|
||||
return Wunsch.each((myWunsch) => {
|
||||
// console.log("MYWUNSCH:")
|
||||
// console.table(myWunsch);
|
||||
let MissionID = myWunsch.missionID;
|
||||
if ($('#' + runnerIframe).attr("mission_id") == "empty") {
|
||||
$('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$('#' + runnerIframe).attr("mission_id", MissionID);
|
||||
// self.UpdateMissionsToDone(MissionID).then(() => {
|
||||
// // console.log('done.... ' + Runner);
|
||||
// $('#' + runnerIframe).attr("src", '');
|
||||
// $('#' + runnerIframe).attr("mission_id", 'empty');
|
||||
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
// })
|
||||
} else {
|
||||
// only while
|
||||
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
}
|
||||
});
|
||||
}).then((Wunsche) => {
|
||||
Wunsche.sort((a, b) => {
|
||||
return a.next_check - b.next_check;
|
||||
});
|
||||
// console.table(Wunsche);
|
||||
if (Wunsche.length > 0) {
|
||||
let myWunsch = Wunsche[0];
|
||||
// console.log("MYWUNSCH:")
|
||||
// console.table(myWunsch);
|
||||
let MissionID = myWunsch.missionID;
|
||||
if ($('#' + runnerIframe).attr("mission_id") == "empty") {
|
||||
$('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$('#' + runnerIframe).attr("mission_id", MissionID);
|
||||
// self.UpdateMissionsToDone(MissionID).then(() => {
|
||||
// // console.log('done.... ' + Runner);
|
||||
// $('#' + runnerIframe).attr("src", '');
|
||||
// $('#' + runnerIframe).attr("mission_id", 'empty');
|
||||
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
// })
|
||||
} else {
|
||||
// only while
|
||||
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
}
|
||||
}
|
||||
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
|
||||
return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
19
src/blub.js
Normal file
19
src/blub.js
Normal file
@@ -0,0 +1,19 @@
|
||||
(() => {
|
||||
let msis = (async () => {
|
||||
return await AutomaticDisposeCall.ADisDB.ADisMissions.where({
|
||||
runner: 'om',
|
||||
available: 'true',
|
||||
done: 'false'
|
||||
}).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).toArray()
|
||||
})();
|
||||
msis.then((result) => {
|
||||
result.sort((a, b) => {
|
||||
return a.next_check > b.next_check;
|
||||
});
|
||||
return result;
|
||||
}).then((sortedResult) => {
|
||||
console.table(sortedResult);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user