WIP page des show
This commit is contained in:
parent
ba62442238
commit
49d44c3ce8
@ -24,13 +24,12 @@ router.get('/:id', function(req, res, next) {
|
|||||||
//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, i.duration as second, i.year as year"
|
db.each("SELECT i.id as id, i.title as title, i.duration as second, i.year as year"
|
||||||
+ " FROM media_items t, metadata_items i "
|
+ " FROM metadata_items i "
|
||||||
+ " WHERE t.metadata_item_id = i.id AND t.hints = '%?%' "
|
+ " WHERE t.metadata_item_id = i.id AND i.parent_id = ? ",req.params.id, function(err, row) {
|
||||||
+ " GROUP BY i.id",req.params.id, function(err, row) {
|
|
||||||
console.log(err);
|
console.log(err);
|
||||||
console.log(row);
|
console.log(row);
|
||||||
//découpage des hints
|
/*//découpage des hints
|
||||||
var params = {};
|
var params = {};
|
||||||
var tab = row.hints.split('&');
|
var tab = row.hints.split('&');
|
||||||
tab.forEach(function(val,index,table){
|
tab.forEach(function(val,index,table){
|
||||||
@ -41,7 +40,7 @@ router.get('/:id', function(req, res, next) {
|
|||||||
|
|
||||||
if(typeof row.info_meta !== 'undefined' && typeof row.info_meta.season !== 'undefined' && typeof row.info_meta.episode !== 'undefined'){
|
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.season_episode = "S"+addZero(row.info_meta.season)+"E"+addZero(row.info_meta.episode);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
row.duree = formatDuree(row.second);
|
row.duree = formatDuree(row.second);
|
||||||
|
|
||||||
|
@ -6,33 +6,16 @@ router.get('/:id', function(req, res, next) {
|
|||||||
var config = require('../config');
|
var config = require('../config');
|
||||||
var db = config.init_db();
|
var db = config.init_db();
|
||||||
|
|
||||||
var shows = {};
|
var shows = [];
|
||||||
|
|
||||||
//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, t.hints as hints, i.year as year"
|
db.each("SELECT id, title, year"
|
||||||
+ " FROM media_items t, metadata_items i "
|
+ " FROM metadata_items "
|
||||||
+ " WHERE t.metadata_item_id = i.id AND t.library_section_id = ? "
|
+ " WHERE parent_id IS NULL AND library_section_id = ? "
|
||||||
,req.params.id, function(err, row) {
|
,req.params.id, function(err, row) {
|
||||||
|
shows.push(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;
|
|
||||||
|
|
||||||
var id = params.show;
|
|
||||||
shows[id] = {
|
|
||||||
'nom': params.show,
|
|
||||||
'id': id
|
|
||||||
};
|
|
||||||
|
|
||||||
if(row.year != '' && row.year != null)
|
|
||||||
shows[id].year = row.year;
|
|
||||||
},
|
},
|
||||||
//aprés toute les opération de la base
|
//aprés toute les opération de la base
|
||||||
function(){
|
function(){
|
||||||
|
@ -9,8 +9,7 @@ block content
|
|||||||
label Télécharger
|
label Télécharger
|
||||||
br
|
br
|
||||||
each file, i in movie.file
|
each file, i in movie.file
|
||||||
a(href="/file/#{file.id}/#{file.filename}")
|
a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename}
|
||||||
#{file.size} #{file.filename}
|
|
||||||
br
|
br
|
||||||
|
|
||||||
label Résumé
|
label Résumé
|
||||||
|
@ -12,7 +12,7 @@ block content
|
|||||||
each show, i in shows
|
each show, i in shows
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
a(href="/show/#{show.id}")= show.nom
|
a(href="/show/#{show.id}")= show.title
|
||||||
td= show.year
|
td= show.year
|
||||||
script.
|
script.
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user