mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue