sync usenet progress before bed

- image attachments on webtv cause server error
- only affects inline embeds
- midi and audio attachments should still work fine
This commit is contained in:
zefie
2022-10-13 02:26:22 -04:00
parent 0b56f02ec4
commit f6db75fca2
6 changed files with 79 additions and 40 deletions

View File

@@ -214,6 +214,36 @@ class WTVShared {
}
}
moveObjectElement(currentKey, afterKey, obj, caseInsensitive = false) {
var result = {};
if (caseInsensitive) {
Object.keys(obj).forEach((k) => {
if (k.toLowerCase() == currentKey.toLowerCase()) {
currentKey = k;
return false;
}
})
}
var val = obj[currentKey];
delete obj[currentKey];
var next = -1;
var i = 0;
if (typeof afterKey == 'undefined' || afterKey == null) afterKey = '';
Object.keys(obj).forEach(function (k) {
var v = obj[k];
if ((afterKey == '' && i == 0) || next == 1) {
result[currentKey] = val;
next = 0;
}
if (k == afterKey || (caseInsensitive && k.toLowerCase() == afterKey.toLowerCase())) { next = 1; }
result[k] = v;
++i;
});
if (next == 1) {
result[currentKey] = val;
}
if (next !== -1) return result; else return obj;
}
readMiniSrvConfig(user_config = true, notices = true, reload_notice = false) {
if (notices || reload_notice) console.log(" *** Reading global configuration...");