From 04ae434870e49be2a85aac5a46e5b1fedd34c887 Mon Sep 17 00:00:00 2001 From: WEBER Antoine Date: Thu, 24 Sep 2015 00:08:51 +0200 Subject: [PATCH] debug --- routes/channel.js | 2 +- routes/movie.js | 2 +- routes/show.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routes/channel.js b/routes/channel.js index eb60afd..348624b 100644 --- a/routes/channel.js +++ b/routes/channel.js @@ -54,7 +54,7 @@ router.get('/:id', function(req, res, next) { channel_info = row; }); - db.each("SELECT i.id as id, i.title as title, t.hints as hints 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, i.duration as second, t.size as size, i.year as year" + " FROM media_items t, metadata_items i " + " WHERE t.metadata_item_id = i.id AND i.title != '' AND t.library_section_id = ? " + " ORDER BY i.title ASC",req.params.id, function(err, row) { diff --git a/routes/movie.js b/routes/movie.js index 3d79a3b..5d3bc25 100644 --- a/routes/movie.js +++ b/routes/movie.js @@ -16,7 +16,7 @@ router.get('/:id', function(req, res, next) { row.rating = Math.round(row.rating,2); row.file = []; - db.each("SELECT id,file,size,hash,duration FROM media_parts where media_item_id IN (SELECT id FROM media_items WHERE metadata_items_id = ? )",req.params.id, function(error, ligne) { + db.each("SELECT id,file,size,hash,duration FROM media_parts where media_item_id IN (SELECT id FROM media_items WHERE metadata_item_id = ? )",req.params.id, function(error, ligne) { var tab = ligne.file.split('/'); var tab2 = tab[tab.length -1].split('\\'); var filename = tab2[tab2.length -1]; diff --git a/routes/show.js b/routes/show.js index d938d80..7a2dc2f 100644 --- a/routes/show.js +++ b/routes/show.js @@ -10,9 +10,9 @@ router.get('/:id', function(req, res, next) { //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 t.hints = '%Walkin%' " + db.each("SELECT i.id as id, i.title as title, t.hints as hints, i.duration as second, t.size as size, i.year as year" + + " FROM media_items t, metadata_items i " + + " WHERE t.metadata_item_id = i.id AND t.hints = '%?%' " + " ORDER BY i.title ASC",req.params.id, function(err, row) { console.log(err); console.log(row);