summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2023-11-12 10:44:50 +0100
committerTom Smeding <tom@tomsmeding.com>2023-11-12 10:44:50 +0100
commit1e2d621e9b60577e59f8ae65ed07ae995a9fba9f (patch)
tree997457b107952bd19579be8b8bcbf8c16730d213
parent2d129021f8897e79df222d62ea015a02135a5000 (diff)
changes: Don't send file contents uselessly
-rw-r--r--modules/changes/changes.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/changes/changes.js b/modules/changes/changes.js
index 1e61843..8182815 100644
--- a/modules/changes/changes.js
+++ b/modules/changes/changes.js
@@ -338,7 +338,15 @@ module.exports=function(app,io,_moddir){
res.send("URL not found in watch list");
return;
}
- res.json(urls[url]);
+ var res=new Array(urls.length);
+ for(var i=0;i<urls.length;i++){
+ var tl=new Array(urls[i].timeline.length);
+ for(var j=0;j<urls[i].timeline.length; j++){
+ tl[i]=[urls[i].timeline[0],urls[i].timeline[1]];
+ }
+ res[i]={url:urls[i].url,timeline:tl};
+ }
+ res.json(res);
});
app.post("/changes/url",function(req,res){
var url=req.body;