Fixed the issue when using the "Request First Season" it was picking the "Specials" season.

pull/4220/head
tidusjar 3 years ago
parent 33dbf2a0e6
commit 53606e08f5

@ -33,6 +33,14 @@ namespace Ombi.Core.Helpers
public async Task<TvShowRequestBuilderV2> GetShowInfo(int id)
{
TheMovieDbRecord = await MovieDbApi.GetTVInfo(id.ToString());
// Remove 'Specials Season'
var firstSeason = TheMovieDbRecord.seasons.OrderBy(x => x.season_number).FirstOrDefault();
if (firstSeason?.season_number == 0)
{
TheMovieDbRecord.seasons.Remove(firstSeason);
}
BackdropPath = TheMovieDbRecord.Images?.Backdrops?.OrderBy(x => x.VoteCount).ThenBy(x => x.VoteAverage).FirstOrDefault()?.FilePath; ;
DateTime.TryParse(TheMovieDbRecord.first_air_date, out var dt);
@ -149,6 +157,10 @@ namespace Ombi.Core.Helpers
else if (tv.FirstSeason)
{
var first = allEpisodes.OrderBy(x => x.season_number).FirstOrDefault();
if (first.season_number == 0)
{
first = allEpisodes.OrderBy(x => x.season_number).Skip(1).FirstOrDefault();
}
var episodesRequests = new List<EpisodeRequests>();
foreach (var ep in allEpisodes)
{

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Ombi.Api.TheMovieDb.Models
{
@ -26,7 +27,7 @@ namespace Ombi.Api.TheMovieDb.Models
public float popularity { get; set; }
public string poster_path { get; set; }
public Production_Companies[] production_companies { get; set; }
public Season[] seasons { get; set; }
public List<Season> seasons { get; set; }
public string status { get; set; }
public string type { get; set; }
public float vote_average { get; set; }

Loading…
Cancel
Save