usenet fixes

This commit is contained in:
zefie
2022-10-12 17:32:20 -04:00
parent 73dc2aea25
commit 048a609756
2 changed files with 2 additions and 11 deletions

View File

@@ -114,7 +114,6 @@ class WTVNews {
data.next_article = res.article.articleNumber;
resolve(data.next_article);
}).catch((e) => {
console.log(e);
data.next_article = null;
resolve(data.next_article);
})
@@ -124,7 +123,6 @@ class WTVNews {
promises.push(new Promise((resolve, reject) => {
this.client.last().then((res) => {
data.prev_article = res.article.articleNumber;
console.log(data.prev_article, articleID)
if (data.prev_article === articleID) {
// do it again, needed this for CodoSoft NNTPd?
this.client.article(data.prev_article).then(() => {

View File

@@ -202,11 +202,9 @@ class WTVNewsServer {
articleNumbers.push(articleNumber);
});
articleNumbers.sort((a, b) => a - b)
var index = articleNumbers.findIndex((e) => e = current);
console.log('index last', index, "article", articleNumbers[index], "current", current)
var index = articleNumbers.findIndex((e) => e == current) - 1;
if (index >= 0) res = articleNumbers[index];
} catch (e) {
console.log(e);
return e;
}
if (res) {
@@ -229,16 +227,12 @@ class WTVNewsServer {
articleNumbers.push(articleNumber);
});
articleNumbers.sort((a, b) => a - b)
console.log(articleNumbers)
var index = articleNumbers.findIndex((e) => e = current) + 1;
console.log('index next', index, "article", articleNumbers[index], "current", current)
var index = articleNumbers.findIndex((e) => e == current) + 1;
if (index < articleNumbers.length) res = articleNumbers[index];
} catch (e) {
console.log(e);
return e;
}
if (res) {
if (res == current) return null;
var message = this.getArticle(group, res);
if (message.messageId) {
res = { "articleNumber": res, "message_id": message.messageId };
@@ -269,7 +263,6 @@ class WTVNewsServer {
out.total++;
});
} catch (e) {
console.log(e);
out.failed = e;
}
articleNumbers.sort((a, b) => a.index - b.index)