mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 03:28:28 -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
|
@ -29,6 +29,7 @@ namespace PlexRequests.Core.SettingModels
|
||||||
public sealed class PlexSettings : ExternalSettings
|
public sealed class PlexSettings : ExternalSettings
|
||||||
{
|
{
|
||||||
public bool AdvancedSearch { get; set; }
|
public bool AdvancedSearch { get; set; }
|
||||||
|
public bool EnableTvEpisodeSearching { get; set; }
|
||||||
|
|
||||||
public string PlexAuthToken { get; set; }
|
public string PlexAuthToken { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,10 +71,9 @@ namespace PlexRequests.Services.Jobs
|
||||||
private const string TableName = "PlexEpisodes";
|
private const string TableName = "PlexEpisodes";
|
||||||
|
|
||||||
|
|
||||||
public void CacheEpisodes()
|
public void CacheEpisodes(PlexSettings settings)
|
||||||
{
|
{
|
||||||
var videoHashset = new HashSet<Video>();
|
var videoHashset = new HashSet<Video>();
|
||||||
var settings = Plex.GetSettings();
|
|
||||||
// Ensure Plex is setup correctly
|
// Ensure Plex is setup correctly
|
||||||
if (string.IsNullOrEmpty(settings.PlexAuthToken))
|
if (string.IsNullOrEmpty(settings.PlexAuthToken))
|
||||||
{
|
{
|
||||||
|
@ -144,6 +143,12 @@ namespace PlexRequests.Services.Jobs
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var s = Plex.GetSettings();
|
||||||
|
if (!s.EnableTvEpisodeSearching)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jobs = Job.GetJobs();
|
var jobs = Job.GetJobs();
|
||||||
var job = jobs.FirstOrDefault(x => x.Name.Equals(JobNames.EpisodeCacher, StringComparison.CurrentCultureIgnoreCase));
|
var job = jobs.FirstOrDefault(x => x.Name.Equals(JobNames.EpisodeCacher, StringComparison.CurrentCultureIgnoreCase));
|
||||||
if (job != null)
|
if (job != null)
|
||||||
|
@ -153,7 +158,7 @@ namespace PlexRequests.Services.Jobs
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheEpisodes();
|
CacheEpisodes(s);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,25 @@
|
||||||
<small>If enabled we will be able to have a 100% accurate match, but we will be querying Plex for every single item in your library. So if you have a big library then this could take some time.</small>
|
<small>If enabled we will be able to have a 100% accurate match, but we will be querying Plex for every single item in your library. So if you have a big library then this could take some time.</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="checkbox">
|
||||||
|
|
||||||
|
@if (Model.EnableTvEpisodeSearching)
|
||||||
|
{
|
||||||
|
<input type="checkbox" id="EnableTvEpisodeSearching" name="EnableTvEpisodeSearching" checked="checked"><label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input type="checkbox" id="EnableTvEpisodeSearching" name="EnableTvEpisodeSearching"><label for="EnableTvEpisodeSearching">Enable Episode Searching</label>
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<small>
|
||||||
|
If enabled then we will lookup all episodes on your Plex server and store them in the local database. This will stop episode requests that already exist on Plex (that might not be in Sonarr).
|
||||||
|
Please be aware that this is a very resource intensive process and while the Plex Episode Cacher job is running the application may appear slow (Depending on the size of your Plex library).
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="SubDir" class="control-label">Plex Base Url</label>
|
<label for="SubDir" class="control-label">Plex Base Url</label>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue