mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added more background images and it will loop through the available ones
This commit is contained in:
parent
e059b521dd
commit
c5274cf893
4 changed files with 31 additions and 17 deletions
|
@ -150,9 +150,9 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
var retVal = new ProcessedContent();
|
var retVal = new ProcessedContent();
|
||||||
var contentProcessed = new Dictionary<int, int>();
|
var contentProcessed = new Dictionary<int, int>();
|
||||||
var episodesProcessed = new List<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);
|
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.
|
// Let's now process this.
|
||||||
var contentToAdd = new HashSet<PlexServerContent>();
|
var contentToAdd = new HashSet<PlexServerContent>();
|
||||||
|
@ -163,7 +163,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
{
|
{
|
||||||
if (content.viewGroup.Equals(PlexMediaType.Episode.ToString(), StringComparison.CurrentCultureIgnoreCase))
|
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;
|
var count = 0;
|
||||||
foreach (var epInfo in content.Metadata ?? new Metadata[]{})
|
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))
|
if (content.viewGroup.Equals(PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
// Process Shows
|
// Process Shows
|
||||||
Logger.LogInformation("Processing TV Shows");
|
Logger.LogDebug("Processing TV Shows");
|
||||||
var count = 0;
|
var count = 0;
|
||||||
foreach (var show in content.Metadata ?? new Metadata[] { })
|
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))
|
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[] { })
|
foreach (var movie in content?.Metadata ?? new Metadata[] { })
|
||||||
{
|
{
|
||||||
// Let's check if we have this movie
|
// Let's check if we have this movie
|
||||||
|
@ -251,7 +251,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
//var existing = await Repo.GetByKey(movie.ratingKey);
|
//var existing = await Repo.GetByKey(movie.ratingKey);
|
||||||
if (existing != null)
|
if (existing != null)
|
||||||
{
|
{
|
||||||
Logger.LogInformation("We already have movie {0}", movie.title);
|
Logger.LogDebug("We already have movie {0}", movie.title);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
await Repo.Delete(hasSameKey);
|
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,
|
var metaData = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri,
|
||||||
movie.ratingKey);
|
movie.ratingKey);
|
||||||
var providerIds = PlexHelper.GetProviderIdFromPlexGuid(metaData.MediaContainer.Metadata
|
var providerIds = PlexHelper.GetProviderIdFromPlexGuid(metaData.MediaContainer.Metadata
|
||||||
|
@ -421,7 +421,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
{
|
{
|
||||||
try
|
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);
|
existingContent.Title);
|
||||||
// Ok so we have it, let's check if there are any new seasons
|
// Ok so we have it, let's check if there are any new seasons
|
||||||
var itemAdded = false;
|
var itemAdded = false;
|
||||||
|
@ -472,7 +472,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
{
|
{
|
||||||
try
|
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
|
// 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...
|
// 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();
|
.Select(x => x.Key.ToString()).ToList();
|
||||||
if (!keys.Contains(dir.key))
|
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
|
// We are not monitoring this lib
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
});
|
});
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
this.cycleBackground();
|
this.cycleBackground();
|
||||||
}, 10000);
|
}, 7000);
|
||||||
|
|
||||||
const base = this.location.getBaseHrefFromDOM();
|
const base = this.location.getBaseHrefFromDOM();
|
||||||
if (base.length > 1) {
|
if (base.length > 1) {
|
||||||
|
|
|
@ -201,7 +201,10 @@ namespace Ombi.Controllers
|
||||||
result = await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value);
|
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())
|
if (tvArray.Any())
|
||||||
{
|
{
|
||||||
|
@ -212,8 +215,10 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
result = await FanartTvApi.GetTvImages(tvArray[item], key.Value);
|
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))
|
if (!string.IsNullOrEmpty(movieUrl) && !string.IsNullOrEmpty(tvUrl))
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"IncludeScopes": false,
|
"IncludeScopes": false,
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Debug",
|
"Default": "Information",
|
||||||
"System": "Debug",
|
"System": "Information",
|
||||||
"Microsoft": "None",
|
"Microsoft": "None",
|
||||||
"Hangfire": "None"
|
"Hangfire": "None"
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,13 @@
|
||||||
155,
|
155,
|
||||||
13,
|
13,
|
||||||
1891,
|
1891,
|
||||||
399106
|
399106,
|
||||||
|
351286,
|
||||||
|
348350,
|
||||||
|
260513,
|
||||||
|
372058,
|
||||||
|
299536,
|
||||||
|
383498
|
||||||
],
|
],
|
||||||
"TvShows": [
|
"TvShows": [
|
||||||
121361,
|
121361,
|
||||||
|
@ -36,7 +42,10 @@
|
||||||
81189,
|
81189,
|
||||||
79126,
|
79126,
|
||||||
79349,
|
79349,
|
||||||
275274
|
275274,
|
||||||
|
305288,
|
||||||
|
296762,
|
||||||
|
280619
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue