From 07c00d232c3b9cb0ee211ba44fb75c412a62ffa0 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 20 Apr 2016 13:38:41 +0100 Subject: [PATCH] small changes --- PlexRequests.Core/Setup.cs | 4 ++-- .../Jobs/PlexAvailabilityChecker.cs | 12 ++++-------- PlexRequests.UI/Modules/SearchModule.cs | 7 +++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/PlexRequests.Core/Setup.cs b/PlexRequests.Core/Setup.cs index 73c4b0554..70d9e6083 100644 --- a/PlexRequests.Core/Setup.cs +++ b/PlexRequests.Core/Setup.cs @@ -139,7 +139,7 @@ namespace PlexRequests.Core } catch (Exception ex) { - Log.Error("Failed to cache Sonarr quality profiles!", ex); + Log.Error(ex, "Failed to cache Sonarr quality profiles!"); } } @@ -161,7 +161,7 @@ namespace PlexRequests.Core } catch (Exception ex) { - Log.Error("Failed to cache CouchPotato quality profiles!", ex); + Log.Error(ex, "Failed to cache CouchPotato quality profiles!"); } } diff --git a/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs b/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs index bb8f957a0..cf2de344d 100644 --- a/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs +++ b/PlexRequests.Services/Jobs/PlexAvailabilityChecker.cs @@ -96,8 +96,8 @@ namespace PlexRequests.Services.Jobs if (libraries == null) { - libraries = new List() { PlexApi.SearchContent(authSettings.PlexAuthToken, r.Title, plexSettings.FullUri) }; - if (libraries == null) + libraries = new List { PlexApi.SearchContent(authSettings.PlexAuthToken, r.Title, plexSettings.FullUri) }; + if (libraries.Count == 0) { Log.Trace("Could not find any matching result for this title."); continue; @@ -105,7 +105,6 @@ namespace PlexRequests.Services.Jobs } Log.Trace("Search results from Plex for the following request: {0}", r.Title); - //Log.Trace(results.DumpJson()); var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy"); @@ -136,8 +135,7 @@ namespace PlexRequests.Services.Jobs } Log.Trace("Updating the requests now"); - Log.Trace("Requests that will be updates:"); - Log.Trace(modifiedModel.SelectMany(x => x.Title).DumpJson()); + Log.Trace("Requests that will be updated count {0}", modifiedModel.Count); if (modifiedModel.Any()) { @@ -257,9 +255,7 @@ namespace PlexRequests.Services.Jobs } else { - results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => { - return GetLibraries(authSettings, plexSettings); - }, 10); + results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => GetLibraries(authSettings, plexSettings), 10); } return results; } diff --git a/PlexRequests.UI/Modules/SearchModule.cs b/PlexRequests.UI/Modules/SearchModule.cs index 78bf7540d..99150f4c8 100644 --- a/PlexRequests.UI/Modules/SearchModule.cs +++ b/PlexRequests.UI/Modules/SearchModule.cs @@ -164,7 +164,6 @@ namespace PlexRequests.UI.Modules private Response ProcessMovies(MovieSearchType searchType, string searchTerm) { List taskList = new List(); - var cpSettings = CpService.GetSettings(); List apiMovies = new List(); taskList.Add(Task.Factory.StartNew>(() => @@ -264,9 +263,9 @@ namespace PlexRequests.UI.Modules { Log.Trace("Searching for TV Show {0}", searchTerm); - List taskList = new List(); + var taskList = new List(); - List apiTv = new List(); + var apiTv = new List(); taskList.Add(Task.Factory.StartNew(() => { return new TvMazeApi().Search(searchTerm); @@ -276,7 +275,7 @@ namespace PlexRequests.UI.Modules apiTv = t.Result; })); - Dictionary dbTv = new Dictionary(); + var dbTv = new Dictionary(); taskList.Add(Task.Factory.StartNew(() => { return RequestService.GetAll().Where(x => x.Type == RequestType.TvShow);