Added the demo to the new apis... I hate that fruit company, lets see if we can get approved now

This commit is contained in:
tidusjar 2021-05-19 20:23:15 +01:00
parent 238a673c56
commit 6e51f7f864
6 changed files with 491 additions and 3 deletions

View file

@ -48,6 +48,8 @@ namespace Ombi.Core.Engine
protected readonly ISettingsService<OmbiSettings> OmbiSettings;
protected readonly IRepository<RequestSubscription> _subscriptionRepository;
private bool _demo = DemoSingleton.Instance.Demo;
protected async Task<Dictionary<int, MovieRequests>> GetMovieRequests()
{
var now = DateTime.Now.Ticks;
@ -193,6 +195,23 @@ namespace Ombi.Core.Engine
return ombiSettings ?? (ombiSettings = await OmbiSettings.GetSettingsAsync());
}
protected bool DemoCheck(string title)
{
if (!title.HasValue())
{
return false;
}
if (_demo)
{
if (ExcludedDemo.ExcludedContent.Any(x => title.Contains(x, System.Globalization.CompareOptions.OrdinalIgnoreCase)))
{
return true;
}
return false;
}
return false;
}
public class HideResult
{
public bool Hide { get; set; }