Added more background images and it will loop through the available ones

pull/2332/head
Jamie Rees 7 years ago
parent e059b521dd
commit c5274cf893

@ -150,9 +150,9 @@ namespace Ombi.Schedule.Jobs.Plex
var retVal = new ProcessedContent();
var contentProcessed = new Dictionary<int, int>();
var episodesProcessed = new List<int>();
Logger.LogInformation("Getting all content from server {0}", servers.Name);
Logger.LogDebug("Getting all content from server {0}", servers.Name);
var allContent = await GetAllContent(servers, recentlyAddedSearch);
Logger.LogInformation("We found {0} items", allContent.Count);
Logger.LogDebug("We found {0} items", allContent.Count);
// Let's now process this.
var contentToAdd = new HashSet<PlexServerContent>();
@ -163,7 +163,7 @@ namespace Ombi.Schedule.Jobs.Plex
{
if (content.viewGroup.Equals(PlexMediaType.Episode.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
Logger.LogInformation("Found some episodes, this must be a recently added sync");
Logger.LogDebug("Found some episodes, this must be a recently added sync");
var count = 0;
foreach (var epInfo in content.Metadata ?? new Metadata[]{})
{
@ -208,7 +208,7 @@ namespace Ombi.Schedule.Jobs.Plex
if (content.viewGroup.Equals(PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
// Process Shows
Logger.LogInformation("Processing TV Shows");
Logger.LogDebug("Processing TV Shows");
var count = 0;
foreach (var show in content.Metadata ?? new Metadata[] { })
{
@ -237,7 +237,7 @@ namespace Ombi.Schedule.Jobs.Plex
}
if (content.viewGroup.Equals(PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase))
{
Logger.LogInformation("Processing Movies");
Logger.LogDebug("Processing Movies");
foreach (var movie in content?.Metadata ?? new Metadata[] { })
{
// Let's check if we have this movie
@ -251,7 +251,7 @@ namespace Ombi.Schedule.Jobs.Plex
//var existing = await Repo.GetByKey(movie.ratingKey);
if (existing != null)
{
Logger.LogInformation("We already have movie {0}", movie.title);
Logger.LogDebug("We already have movie {0}", movie.title);
continue;
}
@ -261,7 +261,7 @@ namespace Ombi.Schedule.Jobs.Plex
await Repo.Delete(hasSameKey);
}
Logger.LogInformation("Adding movie {0}", movie.title);
Logger.LogDebug("Adding movie {0}", movie.title);
var metaData = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri,
movie.ratingKey);
var providerIds = PlexHelper.GetProviderIdFromPlexGuid(metaData.MediaContainer.Metadata
@ -421,7 +421,7 @@ namespace Ombi.Schedule.Jobs.Plex
{
try
{
Logger.LogInformation("We already have show {0} checking for new seasons",
Logger.LogDebug("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;
@ -472,7 +472,7 @@ namespace Ombi.Schedule.Jobs.Plex
{
try
{
Logger.LogInformation("New show {0}, so add it", show.title);
Logger.LogDebug("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...
@ -573,7 +573,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);
Logger.LogDebug("Lib {0} is not monitored, so skipping", dir.key);
// We are not monitoring this lib
continue;
}

@ -84,7 +84,7 @@ export class LoginComponent implements OnDestroy, OnInit {
});
this.timer = setInterval(() => {
this.cycleBackground();
}, 10000);
}, 7000);
const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) {

@ -201,7 +201,10 @@ namespace Ombi.Controllers
result = await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value);
}
movieUrl = result.moviebackground[0].url;
var otherRand = new Random();
var res = otherRand.Next(result.moviebackground.Length);
movieUrl = result.moviebackground[res].url;
}
if (tvArray.Any())
{
@ -212,8 +215,10 @@ namespace Ombi.Controllers
{
result = await FanartTvApi.GetTvImages(tvArray[item], key.Value);
}
var otherRand = new Random();
var res = otherRand.Next(result.showbackground.Length);
tvUrl = result.showbackground[0].url;
tvUrl = result.showbackground[res].url;
}
if (!string.IsNullOrEmpty(movieUrl) && !string.IsNullOrEmpty(tvUrl))

@ -2,8 +2,8 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Debug",
"Default": "Information",
"System": "Information",
"Microsoft": "None",
"Hangfire": "None"
}
@ -28,7 +28,13 @@
155,
13,
1891,
399106
399106,
351286,
348350,
260513,
372058,
299536,
383498
],
"TvShows": [
121361,
@ -36,7 +42,10 @@
81189,
79126,
79349,
275274
275274,
305288,
296762,
280619
]
}
}

Loading…
Cancel
Save