From 91e431fa3c11e034d4d6217888f9177b7dd05663 Mon Sep 17 00:00:00 2001 From: WEBER Antoine Date: Wed, 23 Sep 2015 23:17:40 +0200 Subject: [PATCH] WIP --- routes/show.js | 4 +--- routes/show_list.js | 14 +++----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/routes/show.js b/routes/show.js index abd4f4d..cfdbc5a 100644 --- a/routes/show.js +++ b/routes/show.js @@ -15,14 +15,12 @@ router.get('/:id', function(req, res, next) { var db = config.init_db(); var shows = {}; - var id = atob(req.params.id); + var id = /*atob(*/req.params.id/*)*/; console.log(id); //on fais toute les opération de base a la suite db.serialize(function() { - - db.each("SELECT i.id as id, i.title as title, t.hints as hints, p.file as file, i.duration as second, t.size as size, i.year as year" + " FROM media_items t, metadata_items i, media_parts p " + " WHERE p.media_item_id=t.id AND t.metadata_item_id = i.id AND i.title != '' AND t.hints LIKE '%show=?%' " diff --git a/routes/show_list.js b/routes/show_list.js index 53aca9e..ff65b40 100644 --- a/routes/show_list.js +++ b/routes/show_list.js @@ -1,14 +1,6 @@ var express = require('express'); var router = express.Router(); -function btoa(string){ - return new Buffer(string).toString('base64'); -} - -function atob(string){ - return new Buffer(string, 'base64').toString('ascii'); -} - /* GET home page. */ router.get('/:id', function(req, res, next) { var config = require('../config'); @@ -33,17 +25,17 @@ router.get('/:id', function(req, res, next) { }); row.info_meta = params; - var id = btoa(row.id); + var id = params.show; shows[id] = { 'nom': params.show, 'id': id }; - + if(row.year != '' && row.year != null) show[id].year = row.year; }, //aprés toute les opération de la base - function() { + function(){ console.log(shows); res.render('show_list', { title: 'Liste des séries',shows: shows }); });