usenet fixes
This commit is contained in:
@@ -114,7 +114,6 @@ class WTVNews {
|
|||||||
data.next_article = res.article.articleNumber;
|
data.next_article = res.article.articleNumber;
|
||||||
resolve(data.next_article);
|
resolve(data.next_article);
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
|
||||||
data.next_article = null;
|
data.next_article = null;
|
||||||
resolve(data.next_article);
|
resolve(data.next_article);
|
||||||
})
|
})
|
||||||
@@ -124,7 +123,6 @@ class WTVNews {
|
|||||||
promises.push(new Promise((resolve, reject) => {
|
promises.push(new Promise((resolve, reject) => {
|
||||||
this.client.last().then((res) => {
|
this.client.last().then((res) => {
|
||||||
data.prev_article = res.article.articleNumber;
|
data.prev_article = res.article.articleNumber;
|
||||||
console.log(data.prev_article, articleID)
|
|
||||||
if (data.prev_article === articleID) {
|
if (data.prev_article === articleID) {
|
||||||
// do it again, needed this for CodoSoft NNTPd?
|
// do it again, needed this for CodoSoft NNTPd?
|
||||||
this.client.article(data.prev_article).then(() => {
|
this.client.article(data.prev_article).then(() => {
|
||||||
|
|||||||
@@ -202,11 +202,9 @@ class WTVNewsServer {
|
|||||||
articleNumbers.push(articleNumber);
|
articleNumbers.push(articleNumber);
|
||||||
});
|
});
|
||||||
articleNumbers.sort((a, b) => a - b)
|
articleNumbers.sort((a, b) => a - b)
|
||||||
var index = articleNumbers.findIndex((e) => e = current);
|
var index = articleNumbers.findIndex((e) => e == current) - 1;
|
||||||
console.log('index last', index, "article", articleNumbers[index], "current", current)
|
|
||||||
if (index >= 0) res = articleNumbers[index];
|
if (index >= 0) res = articleNumbers[index];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
@@ -229,16 +227,12 @@ class WTVNewsServer {
|
|||||||
articleNumbers.push(articleNumber);
|
articleNumbers.push(articleNumber);
|
||||||
});
|
});
|
||||||
articleNumbers.sort((a, b) => a - b)
|
articleNumbers.sort((a, b) => a - b)
|
||||||
console.log(articleNumbers)
|
var index = articleNumbers.findIndex((e) => e == current) + 1;
|
||||||
var index = articleNumbers.findIndex((e) => e = current) + 1;
|
|
||||||
console.log('index next', index, "article", articleNumbers[index], "current", current)
|
|
||||||
if (index < articleNumbers.length) res = articleNumbers[index];
|
if (index < articleNumbers.length) res = articleNumbers[index];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res == current) return null;
|
|
||||||
var message = this.getArticle(group, res);
|
var message = this.getArticle(group, res);
|
||||||
if (message.messageId) {
|
if (message.messageId) {
|
||||||
res = { "articleNumber": res, "message_id": message.messageId };
|
res = { "articleNumber": res, "message_id": message.messageId };
|
||||||
@@ -269,7 +263,6 @@ class WTVNewsServer {
|
|||||||
out.total++;
|
out.total++;
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
out.failed = e;
|
out.failed = e;
|
||||||
}
|
}
|
||||||
articleNumbers.sort((a, b) => a.index - b.index)
|
articleNumbers.sort((a, b) => a.index - b.index)
|
||||||
|
|||||||
Reference in New Issue
Block a user