Adding more logging into the Plex Cacher

pull/1245/head
Jamie.Rees 8 years ago
parent 3843ace4f9
commit 87b2272bdf

@ -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<PlexSearch> 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<PlexSearch>();
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);
}
}

@ -185,14 +185,13 @@ namespace Ombi.UI.Modules
private static Logger Log = LogManager.GetCurrentClassLogger();
private long _plexMovieCacheTime = 0;
private IEnumerable<PlexContent> _plexMovies = null;
private IEnumerable<PlexContent> _plexMovies;
private long _embyMovieCacheTime = 0;
private IEnumerable<EmbyContent> _embyMovies = null;
private IEnumerable<EmbyContent> _embyMovies;
private long _dbMovieCacheTime = 0;
private Dictionary<int, RequestedModel> _dbMovies = null;
private Dictionary<int, RequestedModel> _dbMovies;
private async Task<Negotiator> RequestLoad()
{

Loading…
Cancel
Save