Added an option to disable/enable the Plex episode cacher

This commit is contained in:
tidusjar 2016-08-10 12:39:48 +01:00
commit 963b4e6ee8
3 changed files with 28 additions and 3 deletions

View file

@ -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)
{