WIP
This commit is contained in:
parent
b077b7b2b6
commit
91e431fa3c
@ -15,14 +15,12 @@ router.get('/:id', function(req, res, next) {
|
|||||||
var db = config.init_db();
|
var db = config.init_db();
|
||||||
var shows = {};
|
var shows = {};
|
||||||
|
|
||||||
var id = atob(req.params.id);
|
var id = /*atob(*/req.params.id/*)*/;
|
||||||
console.log(id);
|
console.log(id);
|
||||||
|
|
||||||
//on fais toute les opération de base a la suite
|
//on fais toute les opération de base a la suite
|
||||||
db.serialize(function() {
|
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"
|
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 "
|
+ " 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=?%' "
|
+ " WHERE p.media_item_id=t.id AND t.metadata_item_id = i.id AND i.title != '' AND t.hints LIKE '%show=?%' "
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
var express = require('express');
|
var express = require('express');
|
||||||
var router = express.Router();
|
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. */
|
/* GET home page. */
|
||||||
router.get('/:id', function(req, res, next) {
|
router.get('/:id', function(req, res, next) {
|
||||||
var config = require('../config');
|
var config = require('../config');
|
||||||
@ -33,17 +25,17 @@ router.get('/:id', function(req, res, next) {
|
|||||||
});
|
});
|
||||||
row.info_meta = params;
|
row.info_meta = params;
|
||||||
|
|
||||||
var id = btoa(row.id);
|
var id = params.show;
|
||||||
shows[id] = {
|
shows[id] = {
|
||||||
'nom': params.show,
|
'nom': params.show,
|
||||||
'id': id
|
'id': id
|
||||||
};
|
};
|
||||||
|
|
||||||
if(row.year != '' && row.year != null)
|
if(row.year != '' && row.year != null)
|
||||||
show[id].year = row.year;
|
show[id].year = row.year;
|
||||||
},
|
},
|
||||||
//aprés toute les opération de la base
|
//aprés toute les opération de la base
|
||||||
function() {
|
function(){
|
||||||
console.log(shows);
|
console.log(shows);
|
||||||
res.render('show_list', { title: 'Liste des séries',shows: shows });
|
res.render('show_list', { title: 'Liste des séries',shows: shows });
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user