From bc9df31d38b618b34b0437cc2757dc04ef99cfed Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Fri, 12 Nov 2021 07:05:57 -0700 Subject: [PATCH] Update ruleset, fix warnings --- .../Providers/TvMazeEpisodeImageProvider.cs | 4 +- .../Providers/TvMazeEpisodeProvider.cs | 6 +- .../Providers/TvMazeSeasonImageProvider.cs | 2 +- .../Providers/TvMazeSeriesImageProvider.cs | 8 +- .../Providers/TvMazeSeriesProvider.cs | 18 +- jellyfin.ruleset | 180 ++++++++++-------- 6 files changed, 122 insertions(+), 96 deletions(-) diff --git a/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeImageProvider.cs b/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeImageProvider.cs index f92c466..3a846d6 100644 --- a/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeImageProvider.cs +++ b/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeImageProvider.cs @@ -55,7 +55,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers { try { - _logger.LogDebug("[GetImages] {name}", item.Name); + _logger.LogDebug("[GetImages] {Name}", item.Name); var episode = (Episode)item; var series = episode.Series; if (series == null) @@ -96,7 +96,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers }); } - _logger.LogInformation("[GetImages] Images found for {name}: {@images}", item.Name, imageResults); + _logger.LogInformation("[GetImages] Images found for {Name}: {@Images}", item.Name, imageResults); return imageResults; } catch (Exception e) diff --git a/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeProvider.cs b/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeProvider.cs index 063a890..4fd07a7 100644 --- a/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeProvider.cs +++ b/Jellyfin.Plugin.TvMaze/Providers/TvMazeEpisodeProvider.cs @@ -43,7 +43,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers { try { - _logger.LogDebug("[GetSearchResults] Starting for {name} {seasonNumber}x{episodeNumber}", searchInfo.Name, searchInfo.ParentIndexNumber, searchInfo.IndexNumber); + _logger.LogDebug("[GetSearchResults] Starting for {Name} {SeasonNumber}x{EpisodeNumber}", searchInfo.Name, searchInfo.ParentIndexNumber, searchInfo.IndexNumber); var results = new List(); var tvMazeId = TvHelpers.GetTvMazeId(searchInfo.SeriesProviderIds); @@ -69,7 +69,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers }); } - _logger.LogDebug("[GetSearchResults] Results for {name}: {@episode}", searchInfo.Name, results); + _logger.LogDebug("[GetSearchResults] Results for {Name}: {@Episode}", searchInfo.Name, results); return results; } catch (Exception e) @@ -85,7 +85,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers var result = new MetadataResult(); try { - _logger.LogDebug("[GetMetadata] Starting for {name}", info.Name); + _logger.LogDebug("[GetMetadata] Starting for {Name}", info.Name); var episode = await GetMetadataInternal(info).ConfigureAwait(false); if (episode != null) { diff --git a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeasonImageProvider.cs b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeasonImageProvider.cs index cc99629..d538f3a 100644 --- a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeasonImageProvider.cs +++ b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeasonImageProvider.cs @@ -70,7 +70,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers } var imageResults = await GetSeasonImagesInternal(series, season.IndexNumber.Value).ConfigureAwait(false); - _logger.LogInformation("[GetImages] Images found for {name}: {@images}", item.Name, imageResults); + _logger.LogInformation("[GetImages] Images found for {Name}: {@Images}", item.Name, imageResults); return imageResults; } catch (Exception e) diff --git a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesImageProvider.cs b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesImageProvider.cs index a8f455e..42801b3 100644 --- a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesImageProvider.cs +++ b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesImageProvider.cs @@ -58,13 +58,13 @@ namespace Jellyfin.Plugin.TvMaze.Providers { try { - _logger.LogDebug("[GetImages] {name}", item.Name); + _logger.LogDebug("[GetImages] {Name}", item.Name); var series = (Series)item; var tvMazeId = TvHelpers.GetTvMazeId(series.ProviderIds); if (tvMazeId == null) { // Requires series TVMaze id. - _logger.LogWarning("[GetImages] TVMaze id is required;"); + _logger.LogWarning("[GetImages] TVMaze id is required"); return Enumerable.Empty(); } @@ -72,7 +72,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers var images = await tvMazeClient.Shows.GetShowImagesAsync(tvMazeId.Value).ConfigureAwait(false); if (images == null) { - _logger.LogDebug("[GetImages] No images found."); + _logger.LogDebug("[GetImages] No images found"); return Enumerable.Empty(); } @@ -92,7 +92,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers } } - _logger.LogInformation("[GetImages] Images found for {name}: {@images}", item.Name, imageResults); + _logger.LogInformation("[GetImages] Images found for {Name}: {@Images}", item.Name, imageResults); return imageResults; } catch (Exception e) diff --git a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesProvider.cs b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesProvider.cs index 820da12..01b65c2 100644 --- a/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesProvider.cs +++ b/Jellyfin.Plugin.TvMaze/Providers/TvMazeSeriesProvider.cs @@ -52,14 +52,14 @@ namespace Jellyfin.Plugin.TvMaze.Providers { try { - _logger.LogDebug("[GetSearchResults] Starting for {name}", searchInfo.Name); + _logger.LogDebug("[GetSearchResults] Starting for {Name}", searchInfo.Name); var tvMazeClient = new TvMazeClient(_httpClientFactory.CreateClient(NamedClient.Default), new RetryRateLimitingStrategy()); var showSearchResults = (await tvMazeClient.Search.ShowSearchAsync(searchInfo.Name?.Trim()).ConfigureAwait(false)).ToList(); - _logger.LogDebug("[GetSearchResults] Result count for {name}: {count}", searchInfo.Name, showSearchResults.Count); + _logger.LogDebug("[GetSearchResults] Result count for {Name}: {Count}", searchInfo.Name, showSearchResults.Count); var searchResults = new List(); foreach (var show in showSearchResults) { - _logger.LogDebug("[GetSearchResults] Result for {name}: {@show}", searchInfo.Name, show); + _logger.LogDebug("[GetSearchResults] Result for {Name}: {@Show}", searchInfo.Name, show); var searchResult = new RemoteSearchResult { Name = show.Show.Name, @@ -77,12 +77,12 @@ namespace Jellyfin.Plugin.TvMaze.Providers searchResults.Add(searchResult); } - _logger.LogDebug("[GetSearchResults] Result for {name}: {@series}", searchInfo.Name, searchResults); + _logger.LogDebug("[GetSearchResults] Result for {Name}: {@Series}", searchInfo.Name, searchResults); return searchResults; } catch (Exception e) { - _logger.LogWarning(e, "[GetSearchResults] Error searching for {name}", searchInfo.Name); + _logger.LogWarning(e, "[GetSearchResults] Error searching for {Name}", searchInfo.Name); return Enumerable.Empty(); } } @@ -92,7 +92,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers { try { - _logger.LogDebug("[GetMetadata] Starting for {name}", info.Name); + _logger.LogDebug("[GetMetadata] Starting for {Name}", info.Name); var tvMazeClient = new TvMazeClient(_httpClientFactory.CreateClient(NamedClient.Default), new RetryRateLimitingStrategy()); var result = new MetadataResult(); @@ -133,14 +133,14 @@ namespace Jellyfin.Plugin.TvMaze.Providers { // Series still not found, search by name. var parsedName = _libraryManager.ParseName(info.Name); - _logger.LogDebug("[GetMetadata] No TVMaze Id, searching by parsed name: {@name}", parsedName); + _logger.LogDebug("[GetMetadata] No TVMaze Id, searching by parsed name: {@Name}", parsedName); tvMazeShow = await GetIdentifyShow(parsedName, tvMazeClient).ConfigureAwait(false); } if (tvMazeShow == null) { // Invalid TVMaze id. - _logger.LogDebug("[GetMetadata] No TVMaze result found for {name}", info.Name); + _logger.LogDebug("[GetMetadata] No TVMaze result found for {Name}", info.Name); return result; } @@ -206,7 +206,7 @@ namespace Jellyfin.Plugin.TvMaze.Providers result.Item = series; result.HasMetadata = true; - _logger.LogDebug("[GetMetadata] Metadata result: {@series}", tvMazeShow); + _logger.LogDebug("[GetMetadata] Metadata result: {@Series}", tvMazeShow); return result; } catch (Exception e) diff --git a/jellyfin.ruleset b/jellyfin.ruleset index a1a75e9..8af791c 100644 --- a/jellyfin.ruleset +++ b/jellyfin.ruleset @@ -1,82 +1,108 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +