This commit is contained in:
WEBER Antoine 2015-09-23 23:17:40 +02:00
parent b077b7b2b6
commit 91e431fa3c
2 changed files with 4 additions and 14 deletions

View File

@ -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=?%' "

View File

@ -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 });
});