From 20f485b2ce2a679ee5d336da63ea7e690a4d2536 Mon Sep 17 00:00:00 2001 From: WEBER Antoine Date: Thu, 24 Sep 2015 00:18:20 +0200 Subject: [PATCH] nettoayge --- routes/channel.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/routes/channel.js b/routes/channel.js index 385acb3..bf92e69 100644 --- a/routes/channel.js +++ b/routes/channel.js @@ -23,22 +23,6 @@ router.get('/:id', function(req, res, next) { } } - function humanFileSize(bytes, si) { - var thresh = si ? 1000 : 1024; - if(Math.abs(bytes) < thresh) { - return bytes + ' B'; - } - var units = si - ? ['kB','MB','GB','TB','PB','EB','ZB','YB'] - : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB']; - var u = -1; - do { - bytes /= thresh; - ++u; - } while(Math.abs(bytes) >= thresh && u < units.length - 1); - return bytes.toFixed(1)+' '+units[u]; - } - //on fais toute les opération de base a la suite db.serialize(function() { @@ -59,21 +43,7 @@ router.get('/:id', function(req, res, next) { + " WHERE i.id = t.metadata_item_id AND i.title != '' AND t.library_section_id = ? " + " ORDER BY i.title ASC",req.params.id, function(err, row) { - //découpage des hints - var params = {}; - var tab = row.hints.split('&'); - tab.forEach(function(val,index,table){ - var tab2 = val.split('='); - params[tab2[0]] = decodeURIComponent(tab2[1]); - }); - row.info_meta = params; - - if(typeof row.info_meta !== 'undefined' && typeof row.info_meta.season !== 'undefined' && typeof row.info_meta.episode !== 'undefined'){ - row.season_episode = "S"+addZero(row.info_meta.season)+"E"+addZero(row.info_meta.episode); - } - row.duree = formatDuree(row.second); - row.size = humanFileSize(row.size,true); data.push(row); },