mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
New: Show ended on add series if applicable
This commit is contained in:
parent
6b04faedbc
commit
2183526a34
@ -25,6 +25,7 @@ public class Show
|
|||||||
public int tvrage_id { get; set; }
|
public int tvrage_id { get; set; }
|
||||||
public int last_updated { get; set; }
|
public int last_updated { get; set; }
|
||||||
public string poster { get; set; }
|
public string poster { get; set; }
|
||||||
|
public bool? ended { get; set; }
|
||||||
public Images images { get; set; }
|
public Images images { get; set; }
|
||||||
public List<string> genres { get; set; }
|
public List<string> genres { get; set; }
|
||||||
public List<Season> seasons { get; set; }
|
public List<Season> seasons { get; set; }
|
||||||
|
@ -78,7 +78,7 @@ private static Series MapSeries(Show show)
|
|||||||
series.Network = show.network;
|
series.Network = show.network;
|
||||||
series.AirTime = show.air_time_utc;
|
series.AirTime = show.air_time_utc;
|
||||||
series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", "");
|
series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", "");
|
||||||
series.Status = GetSeriesStatus(show.status);
|
series.Status = GetSeriesStatus(show.status, show.ended);
|
||||||
|
|
||||||
series.Seasons = show.seasons.Select(s => new Tv.Season
|
series.Seasons = show.seasons.Select(s => new Tv.Season
|
||||||
{
|
{
|
||||||
@ -114,9 +114,17 @@ private static string GetPosterThumbnailUrl(string posterUrl)
|
|||||||
return withoutExtension + "-300" + extension;
|
return withoutExtension + "-300" + extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SeriesStatusType GetSeriesStatus(string status)
|
private static SeriesStatusType GetSeriesStatus(string status, bool? ended)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(status)) return SeriesStatusType.Continuing;
|
if (string.IsNullOrWhiteSpace(status))
|
||||||
|
{
|
||||||
|
if (ended.HasValue && ended.Value)
|
||||||
|
{
|
||||||
|
return SeriesStatusType.Ended;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SeriesStatusType.Continuing;
|
||||||
|
}
|
||||||
if (status.Equals("Ended", StringComparison.InvariantCultureIgnoreCase)) return SeriesStatusType.Ended;
|
if (status.Equals("Ended", StringComparison.InvariantCultureIgnoreCase)) return SeriesStatusType.Ended;
|
||||||
return SeriesStatusType.Continuing;
|
return SeriesStatusType.Continuing;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,12 @@
|
|||||||
<div class="span9">
|
<div class="span9">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h2>{{titleWithYear}}</h2>
|
<h2 class="series-title">
|
||||||
|
{{titleWithYear}}
|
||||||
|
{{#unless_eq status compare="continuing"}}
|
||||||
|
<span class="label label-important">Ended</span>
|
||||||
|
{{/unless_eq}}
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="row new-series-overview x-overview">
|
<div class="row new-series-overview x-overview">
|
||||||
{{overview}}
|
{{overview}}
|
||||||
|
@ -57,6 +57,13 @@
|
|||||||
|
|
||||||
.search-item {
|
.search-item {
|
||||||
|
|
||||||
|
.series-title {
|
||||||
|
.label {
|
||||||
|
margin-left: 15px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.new-series-overview {
|
.new-series-overview {
|
||||||
overflow : hidden;
|
overflow : hidden;
|
||||||
height : 120px;
|
height : 120px;
|
||||||
|
Loading…
Reference in New Issue
Block a user