mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Update UI to display download status.
This commit is contained in:
parent
1dfb4ddcd8
commit
49537a2efe
7 changed files with 59 additions and 1 deletions
|
@ -29,7 +29,7 @@ namespace NzbDrone.Api.Movie
|
||||||
public DateTime? InCinemas { get; set; }
|
public DateTime? InCinemas { get; set; }
|
||||||
public List<MediaCover> Images { get; set; }
|
public List<MediaCover> Images { get; set; }
|
||||||
public string Website { get; set; }
|
public string Website { get; set; }
|
||||||
|
public bool Downloaded { get; set; }
|
||||||
public string RemotePoster { get; set; }
|
public string RemotePoster { get; set; }
|
||||||
public int Year { get; set; }
|
public int Year { get; set; }
|
||||||
|
|
||||||
|
@ -79,6 +79,8 @@ namespace NzbDrone.Api.Movie
|
||||||
{
|
{
|
||||||
if (model == null) return null;
|
if (model == null) return null;
|
||||||
|
|
||||||
|
long Size = model.MovieFile.Value != null ? model.MovieFile.Value.Size : 0;
|
||||||
|
|
||||||
return new MovieResource
|
return new MovieResource
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
|
@ -87,6 +89,8 @@ namespace NzbDrone.Api.Movie
|
||||||
//AlternateTitles
|
//AlternateTitles
|
||||||
SortTitle = model.SortTitle,
|
SortTitle = model.SortTitle,
|
||||||
InCinemas = model.InCinemas,
|
InCinemas = model.InCinemas,
|
||||||
|
|
||||||
|
Downloaded = model.MovieFile.Value != null,
|
||||||
//TotalEpisodeCount
|
//TotalEpisodeCount
|
||||||
//EpisodeCount
|
//EpisodeCount
|
||||||
//EpisodeFileCount
|
//EpisodeFileCount
|
||||||
|
@ -104,6 +108,8 @@ namespace NzbDrone.Api.Movie
|
||||||
|
|
||||||
Monitored = model.Monitored,
|
Monitored = model.Monitored,
|
||||||
|
|
||||||
|
SizeOnDisk = Size,
|
||||||
|
|
||||||
Runtime = model.Runtime,
|
Runtime = model.Runtime,
|
||||||
LastInfoSync = model.LastInfoSync,
|
LastInfoSync = model.LastInfoSync,
|
||||||
CleanTitle = model.CleanTitle,
|
CleanTitle = model.CleanTitle,
|
||||||
|
|
6
src/UI/Cells/MovieDownloadStatusCell.js
Normal file
6
src/UI/Cells/MovieDownloadStatusCell.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
var TemplatedCell = require('./TemplatedCell');
|
||||||
|
|
||||||
|
module.exports = TemplatedCell.extend({
|
||||||
|
className : 'movie-title-cell',
|
||||||
|
template : 'Cells/MovieDownloadStatusTemplate',
|
||||||
|
});
|
1
src/UI/Cells/MovieDownloadStatusTemplate.hbs
Normal file
1
src/UI/Cells/MovieDownloadStatusTemplate.hbs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span>
|
|
@ -127,8 +127,40 @@ Handlebars.registerHelper('GetBannerStatus', function() {
|
||||||
else if (!monitored) {
|
else if (!monitored) {
|
||||||
return new Handlebars.SafeString('<div class="announced-banner"><i class="icon-sonarr-series-unmonitored grid-icon" title=""></i> Not Monitored</div>');
|
return new Handlebars.SafeString('<div class="announced-banner"><i class="icon-sonarr-series-unmonitored grid-icon" title=""></i> Not Monitored</div>');
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('DownloadedStatusColor', function() {
|
||||||
|
if (!this.monitored) {
|
||||||
|
if (this.downloaded) {
|
||||||
|
return "default";
|
||||||
|
}
|
||||||
|
return "warning";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.downloaded) {
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.status != "released") {
|
||||||
|
return "primary";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "danger";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('DownloadedStatus', function() {
|
||||||
|
|
||||||
|
if (this.downloaded) {
|
||||||
|
return "Downloaded";
|
||||||
|
}
|
||||||
|
if (!this.monitored) {
|
||||||
|
return "Not Monitored";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return "Missing";
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Handlebars.registerHelper('inCinemas', function() {
|
Handlebars.registerHelper('inCinemas', function() {
|
||||||
var monthNames = ["January", "February", "March", "April", "May", "June",
|
var monthNames = ["January", "February", "March", "April", "May", "June",
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="label label-default">Announced</span>
|
<span class="label label-default">Announced</span>
|
||||||
{{/if_eq}}
|
{{/if_eq}}
|
||||||
|
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<span class="series-info-links">
|
<span class="series-info-links">
|
||||||
|
|
|
@ -12,6 +12,7 @@ var ProfileCell = require('../../Cells/ProfileCell');
|
||||||
var MovieLinksCell = require('../../Cells/MovieLinksCell');
|
var MovieLinksCell = require('../../Cells/MovieLinksCell');
|
||||||
var MovieActionCell = require('../../Cells/MovieActionCell');
|
var MovieActionCell = require('../../Cells/MovieActionCell');
|
||||||
var MovieStatusCell = require('../../Cells/MovieStatusCell');
|
var MovieStatusCell = require('../../Cells/MovieStatusCell');
|
||||||
|
var MovieDownloadStatusCell = require('../../Cells/MovieDownloadStatusCell');
|
||||||
var FooterView = require('./FooterView');
|
var FooterView = require('./FooterView');
|
||||||
var FooterModel = require('./FooterModel');
|
var FooterModel = require('./FooterModel');
|
||||||
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
|
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
|
||||||
|
@ -55,6 +56,11 @@ module.exports = Marionette.Layout.extend({
|
||||||
cell : MovieLinksCell,
|
cell : MovieLinksCell,
|
||||||
className : "movie-links-cell"
|
className : "movie-links-cell"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name : "this",
|
||||||
|
label : "Status",
|
||||||
|
cell : MovieDownloadStatusCell,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
label : '',
|
label : '',
|
||||||
|
@ -134,6 +140,10 @@ module.exports = Marionette.Layout.extend({
|
||||||
{
|
{
|
||||||
title : 'In Cinemas',
|
title : 'In Cinemas',
|
||||||
name : 'inCinemas'
|
name : 'inCinemas'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title : "Status",
|
||||||
|
name : "status",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
<span class="label label-default">{{inCinemas}}</span>
|
<span class="label label-default">{{inCinemas}}</span>
|
||||||
|
|
||||||
{{profile profileId}}
|
{{profile profileId}}
|
||||||
|
|
||||||
|
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-xs-4">
|
<div class="col-md-4 col-xs-4">
|
||||||
<span class="movie-info-links">
|
<span class="movie-info-links">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue