mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
Added an option to disable/enable the Plex episode cacher
This commit is contained in:
parent
f8457d1db2
commit
963b4e6ee8
3 changed files with 28 additions and 3 deletions
|
@ -71,10 +71,9 @@ namespace PlexRequests.Services.Jobs
|
|||
private const string TableName = "PlexEpisodes";
|
||||
|
||||
|
||||
public void CacheEpisodes()
|
||||
public void CacheEpisodes(PlexSettings settings)
|
||||
{
|
||||
var videoHashset = new HashSet<Video>();
|
||||
var settings = Plex.GetSettings();
|
||||
// Ensure Plex is setup correctly
|
||||
if (string.IsNullOrEmpty(settings.PlexAuthToken))
|
||||
{
|
||||
|
@ -144,6 +143,12 @@ namespace PlexRequests.Services.Jobs
|
|||
{
|
||||
try
|
||||
{
|
||||
var s = Plex.GetSettings();
|
||||
if (!s.EnableTvEpisodeSearching)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var jobs = Job.GetJobs();
|
||||
var job = jobs.FirstOrDefault(x => x.Name.Equals(JobNames.EpisodeCacher, StringComparison.CurrentCultureIgnoreCase));
|
||||
if (job != null)
|
||||
|
@ -153,7 +158,7 @@ namespace PlexRequests.Services.Jobs
|
|||
return;
|
||||
}
|
||||
}
|
||||
CacheEpisodes();
|
||||
CacheEpisodes(s);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue