@ -61,10 +61,10 @@ Handlebars.registerHelper('homepage', function() {
Handlebars . registerHelper ( 'alternativeTitlesString' , function ( ) {
Handlebars . registerHelper ( 'alternativeTitlesString' , function ( ) {
var titles = this . alternativeTitles ;
var titles = this . alternativeTitles ;
if ( titles . length == 0 ) {
if ( titles . length == = 0 ) {
return "" ;
return "" ;
}
}
if ( titles . length == 1 ) {
if ( titles . length == = 1 ) {
return titles [ 0 ] ;
return titles [ 0 ] ;
}
}
return titles . slice ( 0 , titles . length - 1 ) . join ( ", " ) + " and " + titles [ titles . length - 1 ] ;
return titles . slice ( 0 , titles . length - 1 ) . join ( ", " ) + " and " + titles [ titles . length - 1 ] ;
@ -82,12 +82,12 @@ Handlebars.registerHelper('GetStatus', function() {
if ( status === "announced" ) {
if ( status === "announced" ) {
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-announced grid-icon" title=""></i> Announced' ) ;
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-announced grid-icon" title=""></i> Announced' ) ;
}
}
if ( status === "inCinemas" ) {
if ( status === "inCinemas" ) {
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-cinemas grid-icon" title=""></i> In Cinemas' ) ;
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-cinemas grid-icon" title=""></i> In Cinemas' ) ;
}
}
if ( status === 'released' ) {
if ( status === 'released' ) {
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-released grid-icon" title=""></i> Released' ) ;
return new Handlebars . SafeString ( '<i class="icon-sonarr-movie-released grid-icon" title=""></i> Released' ) ;
}
}
@ -95,7 +95,7 @@ Handlebars.registerHelper('GetStatus', function() {
else if ( ! monitored ) {
else if ( ! monitored ) {
return new Handlebars . SafeString ( '<i class="icon-sonarr-series-unmonitored grid-icon" title=""></i> Not Monitored' ) ;
return new Handlebars . SafeString ( '<i class="icon-sonarr-series-unmonitored grid-icon" title=""></i> Not Monitored' ) ;
}
}
} )
} ) ;
Handlebars . registerHelper ( 'GetBannerStatus' , function ( ) {
Handlebars . registerHelper ( 'GetBannerStatus' , function ( ) {
var monitored = this . monitored ;
var monitored = this . monitored ;
@ -138,7 +138,7 @@ Handlebars.registerHelper('DownloadedStatusColor', function() {
}
}
return "danger" ;
return "danger" ;
} )
} ) ;
Handlebars . registerHelper ( 'DownloadedStatus' , function ( ) {
Handlebars . registerHelper ( 'DownloadedStatus' , function ( ) {
@ -157,24 +157,26 @@ Handlebars.registerHelper("DownloadedQuality", function() {
}
}
return "" ;
return "" ;
} )
} ) ;
Handlebars . registerHelper ( 'inCinemas' , function ( ) {
Handlebars . registerHelper ( 'inCinemas' , function ( ) {
var monthNames = [ "January" , "February" , "March" , "April" , "May" , "June" ,
var monthNames = [ "January" , "February" , "March" , "April" , "May" , "June" ,
"July" , "August" , "September" , "October" , "November" , "December"
"July" , "August" , "September" , "October" , "November" , "December"
] ;
] ;
var year , month ;
if ( this . physicalRelease ) {
if ( this . physicalRelease ) {
var d = new Date ( this . physicalRelease ) ;
var d = new Date ( this . physicalRelease ) ;
var day = d . getDate ( ) ;
var day = d . getDate ( ) ;
var month = monthNames [ d . getMonth ( ) ] ;
month = monthNames [ d . getMonth ( ) ] ;
var year = d . getFullYear ( ) ;
year = d . getFullYear ( ) ;
return "Available: " + day + ". " + month + " " + year ;
return "Available: " + day + ". " + month + " " + year ;
}
}
if ( this . inCinemas ) {
if ( this . inCinemas ) {
var cinemasDate = new Date ( this . inCinemas ) ;
var cinemasDate = new Date ( this . inCinemas ) ;
var year = cinemasDate . getFullYear ( ) ;
year = cinemasDate . getFullYear ( ) ;
var month = monthNames [ cinemasDate . getMonth ( ) ] ;
month = monthNames [ cinemasDate . getMonth ( ) ] ;
return "In Cinemas: " + month + " " + year ;
return "In Cinemas: " + month + " " + year ;
}
}
return "To be announced" ;
return "To be announced" ;