mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 20:03:40 +01:00
29 lines
1002 B
JavaScript
29 lines
1002 B
JavaScript
|
const fs = require("fs");
|
||
|
const { nextLinkCheck, nextRssRefresh, get_last_downloaded } = require('.././utils')
|
||
|
|
||
|
|
||
|
module.exports = function (app) {
|
||
|
app.get("/api/stats", (req, res) => {
|
||
|
retryCache = JSON.parse(fs.readFileSync('./cache/retryCache.json'))
|
||
|
for (let index = 0; index < retryCache.length; index++) {
|
||
|
const item = retryCache[index];
|
||
|
retryCache[index].newtitle = item.title.replace(/ /g, "‡");
|
||
|
}
|
||
|
showList = JSON.parse(fs.readFileSync('shows.json'));
|
||
|
feedCache = JSON.parse(fs.readFileSync('./cache/feedCache.json'));
|
||
|
rssTime = nextRssRefresh()
|
||
|
linkCheck = nextLinkCheck()
|
||
|
lastDownloaded = get_last_downloaded()
|
||
|
|
||
|
res.json({
|
||
|
"ShowList": showList.length,
|
||
|
"FeedCache": feedCache.length,
|
||
|
"RetryCache": retryCache.length,
|
||
|
"RSSCheck": rssTime,
|
||
|
"LinkChecker": linkCheck,
|
||
|
"LastDownloaded": lastDownloaded
|
||
|
});
|
||
|
});
|
||
|
|
||
|
}
|