mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Fixed the issue when using the "Request First Season" it was picking the "Specials" season.
This commit is contained in:
parent
33dbf2a0e6
commit
53606e08f5
2 changed files with 14 additions and 1 deletions
|
@ -33,6 +33,14 @@ namespace Ombi.Core.Helpers
|
||||||
public async Task<TvShowRequestBuilderV2> GetShowInfo(int id)
|
public async Task<TvShowRequestBuilderV2> GetShowInfo(int id)
|
||||||
{
|
{
|
||||||
TheMovieDbRecord = await MovieDbApi.GetTVInfo(id.ToString());
|
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; ;
|
BackdropPath = TheMovieDbRecord.Images?.Backdrops?.OrderBy(x => x.VoteCount).ThenBy(x => x.VoteAverage).FirstOrDefault()?.FilePath; ;
|
||||||
|
|
||||||
DateTime.TryParse(TheMovieDbRecord.first_air_date, out var dt);
|
DateTime.TryParse(TheMovieDbRecord.first_air_date, out var dt);
|
||||||
|
@ -149,6 +157,10 @@ namespace Ombi.Core.Helpers
|
||||||
else if (tv.FirstSeason)
|
else if (tv.FirstSeason)
|
||||||
{
|
{
|
||||||
var first = allEpisodes.OrderBy(x => x.season_number).FirstOrDefault();
|
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>();
|
var episodesRequests = new List<EpisodeRequests>();
|
||||||
foreach (var ep in allEpisodes)
|
foreach (var ep in allEpisodes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ombi.Api.TheMovieDb.Models
|
namespace Ombi.Api.TheMovieDb.Models
|
||||||
{
|
{
|
||||||
|
@ -26,7 +27,7 @@ namespace Ombi.Api.TheMovieDb.Models
|
||||||
public float popularity { get; set; }
|
public float popularity { get; set; }
|
||||||
public string poster_path { get; set; }
|
public string poster_path { get; set; }
|
||||||
public Production_Companies[] production_companies { 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 status { get; set; }
|
||||||
public string type { get; set; }
|
public string type { get; set; }
|
||||||
public float vote_average { get; set; }
|
public float vote_average { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue