From 87b2272bdf101e898cfee514ce7cd624b7991c0f Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Tue, 14 Mar 2017 08:07:08 +0000 Subject: [PATCH] Adding more logging into the Plex Cacher --- Ombi.Services/Jobs/PlexContentCacher.cs | 15 ++++++++++++--- Ombi.UI/Modules/SearchModule.cs | 7 +++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Ombi.Services/Jobs/PlexContentCacher.cs b/Ombi.Services/Jobs/PlexContentCacher.cs index 6878c3367..f5879b5df 100644 --- a/Ombi.Services/Jobs/PlexContentCacher.cs +++ b/Ombi.Services/Jobs/PlexContentCacher.cs @@ -201,6 +201,8 @@ namespace Ombi.Services.Jobs results = GetLibraries(plexSettings); if (plexSettings.AdvancedSearch) { + Log.Debug("Going through all the items now"); + Log.Debug($"Item count {results.Count}"); foreach (PlexSearch t in results) { foreach (Directory1 t1 in t.Directory) @@ -236,7 +238,7 @@ namespace Ombi.Services.Jobs } if (results != null) { - + Log.Debug("done all that, moving onto the DB now"); var movies = GetPlexMovies(results); // Time to destroy the plex movies from the DB @@ -279,6 +281,7 @@ namespace Ombi.Services.Jobs } } + Log.Debug("Done movies"); var tv = GetPlexTvShows(results); // Time to destroy the plex tv from the DB PlexContent.Custom(connection => @@ -319,7 +322,7 @@ namespace Ombi.Services.Jobs }); } } - + Log.Debug("Done TV"); var albums = GetPlexAlbums(results); // Time to destroy the plex movies from the DB PlexContent.Custom(connection => @@ -360,10 +363,13 @@ namespace Ombi.Services.Jobs }); } } + Log.Debug("Done albums"); } } catch (Exception ex) { + Log.Debug("Exception:"); + Log.Debug(ex); Log.Error(ex, "Failed to obtain Plex libraries"); } @@ -372,8 +378,10 @@ namespace Ombi.Services.Jobs private List GetLibraries(PlexSettings plexSettings) { + Log.Debug("Getting Lib sections"); var sections = PlexApi.GetLibrarySections(plexSettings.PlexAuthToken, plexSettings.FullUri); - + + Log.Debug("Going through sections now"); var libs = new List(); if (sections != null) { @@ -382,6 +390,7 @@ namespace Ombi.Services.Jobs var lib = PlexApi.GetLibrary(plexSettings.PlexAuthToken, plexSettings.FullUri, dir.Key); if (lib != null) { + Log.Debug("adding lib"); libs.Add(lib); } } diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index dcc2b13d2..c321f4724 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -185,14 +185,13 @@ namespace Ombi.UI.Modules private static Logger Log = LogManager.GetCurrentClassLogger(); private long _plexMovieCacheTime = 0; - private IEnumerable _plexMovies = null; + private IEnumerable _plexMovies; private long _embyMovieCacheTime = 0; - private IEnumerable _embyMovies = null; - + private IEnumerable _embyMovies; private long _dbMovieCacheTime = 0; - private Dictionary _dbMovies = null; + private Dictionary _dbMovies; private async Task RequestLoad() {