v2 up ioago94it0a

This commit is contained in:
2018-12-03 20:20:03 +01:00
parent b9b7e70d87
commit a7354d622d
4 changed files with 71 additions and 60 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 03 2018 15:48:33 GMT+0100 (CET)*/ /*Generated on:Mon Dec 03 2018 20:20:02 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+26 -30
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 03 2018 15:48:33 GMT+0100 (CET)*/ /*Generated on:Mon Dec 03 2018 20:20:02 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -18647,37 +18647,33 @@ class AutomaticDispose {
done: 'false' done: 'false'
}).and(function (item) { }).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000) return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1) }).toArray()
} }
}).then((Wunsch) => { }).then((Wunsche) => {
// console.table(Wunsch); Wunsche.sort((a, b) => {
if (Wunsch !== undefined) { return a.next_check - b.next_check;
return Wunsch.count(function (count) { });
if (count > 0) { // console.table(Wunsche);
return Wunsch.each((myWunsch) => { if (Wunsche.length > 0) {
// console.log("MYWUNSCH:") let myWunsch = Wunsche[0];
// console.table(myWunsch); // console.log("MYWUNSCH:")
let MissionID = myWunsch.missionID; // console.table(myWunsch);
if ($('#' + runnerIframe).attr("mission_id") == "empty") { let MissionID = myWunsch.missionID;
$('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID); if ($('#' + runnerIframe).attr("mission_id") == "empty") {
$('#' + runnerIframe).attr("mission_id", MissionID); $('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
// self.UpdateMissionsToDone(MissionID).then(() => { $('#' + runnerIframe).attr("mission_id", MissionID);
// // console.log('done.... ' + Runner); // self.UpdateMissionsToDone(MissionID).then(() => {
// $('#' + runnerIframe).attr("src", ''); // // console.log('done.... ' + Runner);
// $('#' + runnerIframe).attr("mission_id", 'empty'); // $('#' + runnerIframe).attr("src", '');
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // $('#' + runnerIframe).attr("mission_id", 'empty');
// }) // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} else { // })
// only while } else {
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // only while
} // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}); }
} else {
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}
});
} }
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner); return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}); });
}); });
} }
+25 -29
View File
@@ -1055,37 +1055,33 @@ class AutomaticDispose {
done: 'false' done: 'false'
}).and(function (item) { }).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000) return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1) }).toArray()
} }
}).then((Wunsch) => { }).then((Wunsche) => {
// console.table(Wunsch); Wunsche.sort((a, b) => {
if (Wunsch !== undefined) { return a.next_check - b.next_check;
return Wunsch.count(function (count) { });
if (count > 0) { // console.table(Wunsche);
return Wunsch.each((myWunsch) => { if (Wunsche.length > 0) {
// console.log("MYWUNSCH:") let myWunsch = Wunsche[0];
// console.table(myWunsch); // console.log("MYWUNSCH:")
let MissionID = myWunsch.missionID; // console.table(myWunsch);
if ($('#' + runnerIframe).attr("mission_id") == "empty") { let MissionID = myWunsch.missionID;
$('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID); if ($('#' + runnerIframe).attr("mission_id") == "empty") {
$('#' + runnerIframe).attr("mission_id", MissionID); $('#' + runnerIframe).attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
// self.UpdateMissionsToDone(MissionID).then(() => { $('#' + runnerIframe).attr("mission_id", MissionID);
// // console.log('done.... ' + Runner); // self.UpdateMissionsToDone(MissionID).then(() => {
// $('#' + runnerIframe).attr("src", ''); // // console.log('done.... ' + Runner);
// $('#' + runnerIframe).attr("mission_id", 'empty'); // $('#' + runnerIframe).attr("src", '');
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // $('#' + runnerIframe).attr("mission_id", 'empty');
// }) // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
} else { // })
// only while } else {
// setTimeout(self.OpenNextMission.bind(self), 5000, Runner); // only while
} // setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}); }
} else {
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner);
}
});
} }
return setTimeout(self.OpenNextMission.bind(self), 5000, Runner); return setTimeout(self.OpenNextMission.bind(self), 1000, Runner);
}); });
}); });
} }
+19
View 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);
});
})();