Merge branch 'release' of https://github.com/TwanoO67/plex-web-downloader into release
This commit is contained in:
commit
248723b698
1
app.js
1
app.js
@ -52,6 +52,7 @@ app.use('/channel', require('./routes/channel'));
|
|||||||
app.use('/movie', require('./routes/movie'));
|
app.use('/movie', require('./routes/movie'));
|
||||||
app.use('/show_list', require('./routes/show_list'));
|
app.use('/show_list', require('./routes/show_list'));
|
||||||
app.use('/show', require('./routes/show'));
|
app.use('/show', require('./routes/show'));
|
||||||
|
app.use('/divers', require('./routes/divers'));
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
|
69
routes/divers.js
Normal file
69
routes/divers.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
var express = require('express');
|
||||||
|
var router = express.Router();
|
||||||
|
|
||||||
|
function secondsToString(seconds) {
|
||||||
|
seconds = Math.round(seconds);
|
||||||
|
|
||||||
|
var years = Math.floor(seconds / 31536000);
|
||||||
|
var max =2;
|
||||||
|
var current = 0;
|
||||||
|
var str = "";
|
||||||
|
if (years && current<max) {
|
||||||
|
str+= years + 'y ';
|
||||||
|
current++;
|
||||||
|
}
|
||||||
|
var days = Math.floor((seconds %= 31536000) / 86400);
|
||||||
|
if (days && current<max) {
|
||||||
|
str+= days + 'd ';
|
||||||
|
current++;
|
||||||
|
}
|
||||||
|
var hours = Math.floor((seconds %= 86400) / 3600);
|
||||||
|
if (hours && current<max) {
|
||||||
|
str+= hours + 'h ';
|
||||||
|
current++;
|
||||||
|
}
|
||||||
|
var minutes = Math.floor((seconds %= 3600) / 60);
|
||||||
|
if (minutes && current<max) {
|
||||||
|
str+= minutes + 'm ';
|
||||||
|
current++;
|
||||||
|
}
|
||||||
|
var seconds = seconds % 60;
|
||||||
|
if (seconds && current<max) {
|
||||||
|
str+= seconds + 's ';
|
||||||
|
current++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GET home page. */
|
||||||
|
router.get('/', function(req, res, next) {
|
||||||
|
var config = res.locals.config;//require('../config');
|
||||||
|
var db = config.init_db();
|
||||||
|
|
||||||
|
/*var data = [];
|
||||||
|
//on fais toute les opération de base a la suite
|
||||||
|
db.serialize(function() {
|
||||||
|
|
||||||
|
//db.run("CREATE TABLE if not exists user_info (info TEXT)");
|
||||||
|
//var stmt = db.prepare("INSERT INTO user_info VALUES (?)");
|
||||||
|
//for (var i = 0; i < 10; i++) {
|
||||||
|
// stmt.run("Ipsum " + i);
|
||||||
|
//}
|
||||||
|
//stmt.finalize();
|
||||||
|
|
||||||
|
db.each("SELECT id, name, section_type as type"
|
||||||
|
+ " FROM library_sections ORDER BY name ASC", function(err, row) {
|
||||||
|
data.push(row);
|
||||||
|
},
|
||||||
|
//aprés toute les opération de la base
|
||||||
|
function() {*/
|
||||||
|
res.render('divers', { title: 'Divers',/*channels: data,*/ presentation: config.presentation, uptime: secondsToString(process.uptime()) });
|
||||||
|
/*});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
db.close();*/
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
@ -16,7 +16,7 @@ function addZero(v) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* GET home page. */
|
/* GET home page. */
|
||||||
router.get('/:id', function(req, res, next) {
|
router.get('/:id/:incoming_chan', function(req, res, next) {
|
||||||
var config = res.locals.config;
|
var config = res.locals.config;
|
||||||
var db = config.init_db();
|
var db = config.init_db();
|
||||||
var data = [];
|
var data = [];
|
||||||
@ -58,7 +58,9 @@ router.get('/:id', function(req, res, next) {
|
|||||||
}
|
}
|
||||||
res.render('show',{
|
res.render('show',{
|
||||||
title: titre,
|
title: titre,
|
||||||
videos: data
|
videos: data,
|
||||||
|
channel_id: req.params.incoming_chan,
|
||||||
|
show_id: req.params.id
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ router.get('/:id', function(req, res, next) {
|
|||||||
//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, channel_id: req.params.id });
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ block content
|
|||||||
each video, i in videos
|
each video, i in videos
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
a(href="/movie/#{video.id}")= video.title
|
a(href="/movie/#{video.id}") #{video.title}
|
||||||
td= video.duree
|
td= video.duree
|
||||||
td= video.year
|
td= video.year
|
||||||
script.
|
script.
|
||||||
|
21
views/divers.jade
Normal file
21
views/divers.jade
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
|
||||||
|
h1= title
|
||||||
|
|
||||||
|
| Ce serveur http est open-source
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|
||||||
|
| Venez participer au developpement ici:
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|
||||||
|
a(href="https://github.com/TwanoO67/plex-web-downloader") GitHub
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|
||||||
|
| Le serveur tourne depuis #{uptime}
|
||||||
|
br
|
||||||
|
br
|
@ -3,6 +3,10 @@ extends layout
|
|||||||
block content
|
block content
|
||||||
h1= movie.title
|
h1= movie.title
|
||||||
|
|
||||||
|
a(href="#",onclick="window.history.back();") Retour à la liste
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|
||||||
label Note
|
label Note
|
||||||
p= movie.rating
|
p= movie.rating
|
||||||
|
|
||||||
@ -11,18 +15,18 @@ block content
|
|||||||
each file, i in movie.file
|
each file, i in movie.file
|
||||||
a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename}
|
a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename}
|
||||||
br
|
br
|
||||||
|
br
|
||||||
label Résumé
|
label Résumé
|
||||||
p= movie.summary
|
p= movie.summary
|
||||||
br
|
br
|
||||||
|
br
|
||||||
label Genre
|
label Genre
|
||||||
each tag, i in movie.tags_genre
|
each tag, i in movie.tags_genre
|
||||||
if(tag!='')
|
if(tag!='')
|
||||||
span= tag
|
span= tag
|
||||||
|
|
|
|
||||||
br
|
br
|
||||||
|
br
|
||||||
label Acteurs
|
label Acteurs
|
||||||
each tag, i in movie.tags_star
|
each tag, i in movie.tags_star
|
||||||
if(tag!='')
|
if(tag!='')
|
||||||
|
@ -3,6 +3,10 @@ extends layout
|
|||||||
block content
|
block content
|
||||||
h1= title
|
h1= title
|
||||||
|
|
||||||
|
a(href="/show_list/#{channel_id}") Retour à la liste des séries
|
||||||
|
br
|
||||||
|
br
|
||||||
|
|
||||||
table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
|
table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
@ -13,7 +17,7 @@ block content
|
|||||||
each video, i in videos
|
each video, i in videos
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
a(href="/movie/#{video.id}")= video.titre
|
a(href="/movie/#{video.id}") #{video.titre}
|
||||||
td= video.season_episode
|
td= video.season_episode
|
||||||
td= video.duree
|
td= video.duree
|
||||||
script.
|
script.
|
||||||
|
@ -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.title
|
a(href="/show/#{show.id}/#{channel_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