Added some logging into the PlexCachers and set the log level to informational

pull/1614/head
tidusjar 7 years ago
parent 57f3297892
commit 6c07295a69

@ -68,6 +68,7 @@ namespace Ombi.Schedule.Jobs.Plex
}
if (!ValidateSettings(plexSettings))
{
Logger.LogError("Plex Settings are not valid");
return;
}
@ -76,6 +77,8 @@ namespace Ombi.Schedule.Jobs.Plex
{
await StartTheCache(plexSettings);
Logger.LogInformation("Starting EP Cacher");
BackgroundJob.Enqueue(() => EpisodeCacher.Start());
}
catch (Exception e)
@ -89,6 +92,7 @@ namespace Ombi.Schedule.Jobs.Plex
foreach (var servers in plexSettings.Servers ?? new List<PlexServers>())
{
Logger.LogInformation("Getting all content from server {0}", servers.Name);
var allContent = GetAllContent(servers);
// Let's now process this.
@ -98,6 +102,7 @@ namespace Ombi.Schedule.Jobs.Plex
if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
// Process Shows
Logger.LogInformation("Processing TV Shows");
foreach (var show in content.Metadata)
{
var seasonList = await PlexApi.GetSeasons(servers.PlexAuthToken, servers.FullUri,
@ -118,6 +123,7 @@ namespace Ombi.Schedule.Jobs.Plex
var existingContent = await Repo.GetByKey(show.ratingKey);
if (existingContent != null)
{
Logger.LogInformation("We already have show {0} checking for new seasons", existingContent.Title);
// Ok so we have it, let's check if there are any new seasons
var itemAdded = false;
foreach (var season in seasonsContent)
@ -139,6 +145,8 @@ namespace Ombi.Schedule.Jobs.Plex
else
{
Logger.LogInformation("New show {0}, so add it", show.title);
// Get the show metadata... This sucks since the `metadata` var contains all information about the show
// But it does not contain the `guid` property that we need to pull out thetvdb id...
var showMetadata = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri,
@ -165,6 +173,7 @@ namespace Ombi.Schedule.Jobs.Plex
}
if (content.viewGroup.Equals(Jobs.PlexContentCacher.PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
Logger.LogInformation("Processing Movies");
foreach (var movie in content?.Metadata ?? new Metadata[]{})
{
// Let's check if we have this movie
@ -174,6 +183,7 @@ namespace Ombi.Schedule.Jobs.Plex
continue;
}
Logger.LogInformation("Adding movie {0}", movie.title);
var metaData = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri,
movie.ratingKey);
var item = new PlexContent
@ -229,6 +239,7 @@ namespace Ombi.Schedule.Jobs.Plex
.Select(x => x.Key.ToString()).ToList();
if (!keys.Contains(dir.key))
{
Logger.LogInformation("Lib {0} is not monitored, so skipping", dir.key);
// We are not monitoring this lib
continue;
}

@ -47,7 +47,6 @@ namespace Ombi.Schedule.Jobs.Plex
foreach (var server in s.Servers)
{
await Cache(server);
BackgroundJob.Enqueue(() => _availabilityChecker.Start());
}
@ -62,6 +61,8 @@ namespace Ombi.Schedule.Jobs.Plex
{
if (!Validate(settings))
{
_log.LogWarning("Validation failed");
return;
}

@ -55,19 +55,19 @@ namespace Ombi
if (string.IsNullOrEmpty(StoragePath.StoragePath))
{
config = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Information()
.WriteTo.RollingFile(Path.Combine(env.ContentRootPath, "Logs", "log-{Date}.txt"))
.WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Debug)
.WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Information)
.CreateLogger();
}
else
{
config = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Information()
.WriteTo.RollingFile(Path.Combine(StoragePath.StoragePath, "Logs", "log-{Date}.txt"))
.WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Debug)
.WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Information)
.CreateLogger();
}
Log.Logger = config;

@ -2,7 +2,9 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
"Default": "Information",
"System": "Information",
"Microsoft": "None"
}
},
"ApplicationSettings": {

Loading…
Cancel
Save