mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-07 04:20:50 +02:00
Fix getting series by TVDB ID from v5 API
This commit is contained in:
parent
2d08abde81
commit
eb97bb563b
2 changed files with 4 additions and 2 deletions
|
|
@ -78,7 +78,8 @@ public static Dictionary<TKey, TValue> ToDictionaryIgnoreDuplicates<TItem, TKey,
|
|||
return result;
|
||||
}
|
||||
|
||||
public static void AddIfNotNull<TSource>(this List<TSource> source, TSource item)
|
||||
#nullable enable
|
||||
public static void AddIfNotNull<TSource>(this List<TSource> source, TSource? item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
|
|
@ -87,6 +88,7 @@ public static void AddIfNotNull<TSource>(this List<TSource> source, TSource item
|
|||
|
||||
source.Add(item);
|
||||
}
|
||||
#nullable disable
|
||||
|
||||
public static bool Empty<TSource>(this IEnumerable<TSource> source)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public List<SeriesResource> AllSeries(int? tvdbId, [FromQuery] SeriesSubresource
|
|||
|
||||
if (tvdbId.HasValue)
|
||||
{
|
||||
seriesResources.AddIfNotNull(_seriesService.FindByTvdbId(tvdbId.Value).ToResource(includeSeasonImages));
|
||||
seriesResources.AddIfNotNull(_seriesService.FindByTvdbId(tvdbId.Value)?.ToResource(includeSeasonImages));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue