From 3308bfd6d355c9f9378dd143b40123f3e15075e2 Mon Sep 17 00:00:00 2001 From: Augusto Franzoia Date: Wed, 4 Oct 2017 21:03:11 -0300 Subject: [PATCH] Add endpoint for last hour preview --- js/src/archiver/server.js | 34 +++++++++++++++++++++++++++++++++- js/src/archiver/server.js.map | 2 +- src/archiver/server.coffee | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/js/src/archiver/server.js b/js/src/archiver/server.js index b6d8017..1b230b7 100644 --- a/js/src/archiver/server.js +++ b/js/src/archiver/server.js @@ -1,4 +1,4 @@ -var CACHE, CACHE_HEADER, NO_CACHE, Server, _, bodyParser, compression, cors, debug, exportKeys, express, moment, onHeaders, sizeof; +var CACHE, CACHE_30_SECONDS, CACHE_HEADER, NO_CACHE, Server, _, bodyParser, compression, cors, debug, exportKeys, express, moment, onHeaders, sizeof; cors = require('cors'); @@ -24,6 +24,8 @@ CACHE_HEADER = 'Cache-Control'; CACHE = 'max-age=3600, smax-age=86400'; +CACHE_30_SECONDS = 'max-age=30'; + NO_CACHE = 'max-age=0, no-cache, must-revalidate'; Server = (function() { @@ -171,6 +173,36 @@ Server = (function() { } }); }); + this.app.get('/:stream/preview-last-hour', function(req, res) { + var previewParams; + previewParams = { + from: moment().subtract(1, 'hours').valueOf(), + to: moment().valueOf() + }; + if (!req.stream.archiver) { + return res.status(404).json({ + status: 404, + error: 'Stream not archived' + }); + } + return req.stream.archiver.getPreview(previewParams, function(error, preview) { + if (error) { + return res.status(500).json({ + status: 500, + error: (error != null ? error.stack : void 0) || error + }); + } else if (!preview) { + return res.status(404).json({ + status: 404, + error: 'Preview not found' + }); + } else { + res.set('X-Archiver-Preview-Length', preview.length); + res.set(CACHE_HEADER, CACHE_30_SECONDS); + return res.json(preview); + } + }); + }); this.app.get('/:stream/segments/:segment', function(req, res) { if (!req.stream.archiver) { return res.status(404).json({ diff --git a/js/src/archiver/server.js.map b/js/src/archiver/server.js.map index add8e7f..d1f60f8 100644 ---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AA,CAAA,CAAA,CAAA,IAAA,CAA3B;IAGX,KAAA,CAAM,SAAN;EAnOS;;;;;;AAyOjB,MAAM,CAAC,OAAP,GAAiB" } \ No newline at end of file diff --git a/src/archiver/server.coffee b/src/archiver/server.coffee index 50e2401..c9ecc68 100644 --- a/src/archiver/server.coffee +++ b/src/archiver/server.coffee @@ -15,6 +15,7 @@ exportKeys = [ ] CACHE_HEADER = 'Cache-Control' CACHE = 'max-age=3600, smax-age=86400' +CACHE_30_SECONDS = 'max-age=30' NO_CACHE = 'max-age=0, no-cache, must-revalidate' class Server @@ -100,6 +101,23 @@ class Server res.set CACHE_HEADER, NO_CACHE res.json preview + @app.get '/:stream/preview-last-hour', (req, res) -> + previewParams = + from: moment().subtract(1, 'hours').valueOf() + to: moment().valueOf() + + if not req.stream.archiver + return res.status(404).json status: 404, error: 'Stream not archived' + req.stream.archiver.getPreview previewParams, (error, preview) -> + if error + res.status(500).json status: 500, error: error?.stack or error + else if not preview + res.status(404).json status: 404, error: 'Preview not found' + else + res.set 'X-Archiver-Preview-Length', preview.length + res.set CACHE_HEADER, CACHE_30_SECONDS + res.json preview + @app.get '/:stream/segments/:segment', (req, res) -> if not req.stream.archiver return res.status(404).json status: 404, error: 'Stream not archived'