mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Merge branch 'dev' into master
This commit is contained in:
commit
f817953ba3
209 changed files with 7250 additions and 993 deletions
|
@ -51,7 +51,7 @@ namespace Ombi.Services.Jobs
|
|||
public class PlexAvailabilityChecker : IJob, IAvailabilityChecker
|
||||
{
|
||||
public PlexAvailabilityChecker(ISettingsService<PlexSettings> plexSettings, IRequestService request, IPlexApi plex, ICacheProvider cache,
|
||||
INotificationService notify, IJobRecord rec, IRepository<UsersToNotify> users, IRepository<PlexEpisodes> repo, INotificationEngine e, IRepository<PlexContent> content)
|
||||
INotificationService notify, IJobRecord rec, IRepository<UsersToNotify> users, IRepository<PlexEpisodes> repo, IPlexNotificationEngine e, IRepository<PlexContent> content)
|
||||
{
|
||||
Plex = plexSettings;
|
||||
RequestService = request;
|
||||
|
@ -82,6 +82,11 @@ namespace Ombi.Services.Jobs
|
|||
|
||||
var plexSettings = Plex.GetSettings();
|
||||
|
||||
if (!plexSettings.Enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateSettings(plexSettings))
|
||||
{
|
||||
Log.Debug("Validation of the plex settings failed.");
|
||||
|
@ -152,7 +157,7 @@ namespace Ombi.Services.Jobs
|
|||
|
||||
if (modifiedModel.Any())
|
||||
{
|
||||
NotificationEngine.NotifyUsers(modifiedModel, plexSettings.PlexAuthToken, NotificationType.RequestAvailable);
|
||||
NotificationEngine.NotifyUsers(modifiedModel, NotificationType.RequestAvailable);
|
||||
RequestService.BatchUpdate(modifiedModel);
|
||||
}
|
||||
}
|
||||
|
@ -388,7 +393,7 @@ namespace Ombi.Services.Jobs
|
|||
currentItem.RatingKey);
|
||||
|
||||
// We do not want "all episodes" this as a season
|
||||
var filtered = seasons.Directory.Where( x => !x.Title.Equals("All episodes", StringComparison.CurrentCultureIgnoreCase));
|
||||
var filtered = seasons.Directory.Where(x => !x.Title.Equals("All episodes", StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
t1.Seasons.AddRange(filtered);
|
||||
}
|
||||
|
@ -447,12 +452,15 @@ namespace Ombi.Services.Jobs
|
|||
|
||||
private bool ValidateSettings(PlexSettings plex)
|
||||
{
|
||||
if (plex?.Ip == null || plex?.PlexAuthToken == null)
|
||||
if (plex.Enable)
|
||||
{
|
||||
Log.Warn("A setting is null, Ensure Plex is configured correctly, and we have a Plex Auth token.");
|
||||
return false;
|
||||
if (plex?.Ip == null || plex?.PlexAuthToken == null)
|
||||
{
|
||||
Log.Warn("A setting is null, Ensure Plex is configured correctly, and we have a Plex Auth token.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return plex.Enable;
|
||||
}
|
||||
|
||||
public void Execute(IJobExecutionContext context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue