Skip to content

Commit

Permalink
fix overlap with tvdb sdk 4.7.9.1 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BobSilent committed Feb 29, 2024
1 parent 69d22ce commit 2e9c25c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbSeasonImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, Cancell
.ConfigureAwait(false);
var seasonArtworkTypeLookup = artworkTypes
.Where(t => string.Equals(t.RecordType, "season", StringComparison.OrdinalIgnoreCase))
.ToDictionary(t => t.Id);
.Where(t => t.Id.HasValue)
.ToDictionary(t => t.Id!.Value);

var seriesTvdbId = series.GetTvdbId();
var seasonNumber = season.IndexNumber.Value;
Expand All @@ -94,7 +95,7 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, Cancell
var remoteImages = new List<RemoteImageInfo>();
foreach (var artwork in seasonArtworks)
{
var artworkType = seasonArtworkTypeLookup.GetValueOrDefault(artwork.Type);
var artworkType = artwork.Type is null ? null : seasonArtworkTypeLookup.GetValueOrDefault(artwork.Type!.Value);
var imageType = artworkType.GetImageType();
var artworkLanguage = artwork.Language is null ? null : languageLookup.GetValueOrDefault(artwork.Language);

Expand Down
5 changes: 3 additions & 2 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbSeriesImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, Cancell
.ConfigureAwait(false);
var seriesArtworkTypeLookup = artworkTypes
.Where(t => string.Equals(t.RecordType, "series", StringComparison.OrdinalIgnoreCase))
.ToDictionary(t => t.Id);
.Where(t => t.Id.HasValue)
.ToDictionary(t => t.Id!.Value);

var seriesTvdbId = item.GetTvdbId();
var seriesArtworks = await GetSeriesArtworks(seriesTvdbId, cancellationToken)
Expand All @@ -90,7 +91,7 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, Cancell
var tvdbId = item.GetTvdbId();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
tvdbId
is useless, since its value is never read.
foreach (var artwork in seriesArtworks)
{
var artworkType = seriesArtworkTypeLookup.GetValueOrDefault(artwork.Type);
var artworkType = artwork.Type is null ? null : seriesArtworkTypeLookup.GetValueOrDefault(artwork.Type!.Value);
var imageType = artworkType.GetImageType();
var artworkLanguage = artwork.Language is null ? null : languageLookup.GetValueOrDefault(artwork.Language);

Expand Down
2 changes: 1 addition & 1 deletion Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private static bool IsMatch(this Translation translation, string? language)
language);
}

private static RemoteImageInfo? CreateRemoteImageInfo(string imageUrl, string thumbnailUrl, (long Width, long Height) imageDimension, string providerName, ImageType? type, Language? language)
private static RemoteImageInfo? CreateRemoteImageInfo(string imageUrl, string thumbnailUrl, (long? Width, long? Height) imageDimension, string providerName, ImageType? type, Language? language)
{
if (type is null)
{
Expand Down

0 comments on commit 2e9c25c

Please sign in to comment.