formattage des nombres

This commit is contained in:
Antoine WEBER 2015-09-22 15:20:02 +02:00
parent bfb3d5260f
commit de715597b6
2 changed files with 7 additions and 3 deletions

View File

@ -40,9 +40,13 @@ router.get('/:id', function(req, res, next) {
var tab2 = val.split('=');
params[tab2[0]] = decodeURIComponent(tab2[1]);
});
row.info_meta = params;
//formattage des données
if(typeof row.info_meta !== 'undefined' && typeof row.info_meta.season !== 'undefined' && typeof row.info_meta.episode !== 'undefined'){
row.season_episode = "S"+row.info_meta.season.toString().replace(/^(\d)$/,'0$1')+"E"+row.info_meta.episode.toString().replace(/^(\d)$/,'0$1');
}
data.push(row);
},
//aprés toute les opération de la base

View File

@ -22,8 +22,8 @@ block content
if(typeof video.info_meta !== 'undefined' && typeof video.info_meta.show !== 'undefined')
| #{video.info_meta.show}
td
if(typeof video.info_meta !== 'undefined' && typeof video.info_meta.season !== 'undefined' && typeof video.info_meta.episode !== 'undefined')
| S #{video.info_meta.season} E #{video.info_meta.episode}
if(typeof video.season_episode !== 'undefined')
| #{video.season_episode}
td= video.second
td= video.year
script.