mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
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:
parent
238a673c56
commit
6e51f7f864
6 changed files with 491 additions and 3 deletions
|
@ -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; }
|
||||
|
|
|
@ -315,6 +315,12 @@ namespace Ombi.Core.Engine.V2
|
|||
foreach (var movie in movies)
|
||||
{
|
||||
var result = await ProcessSingleMovie(movie);
|
||||
|
||||
if (DemoCheck(result.Title))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (settings.HideAvailableFromDiscover && result.Available)
|
||||
{
|
||||
continue;
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace Ombi.Core.Engine.V2
|
|||
private readonly ISettingsService<LidarrSettings> _lidarrSettings;
|
||||
private readonly IMusicBrainzApi _musicApi;
|
||||
|
||||
private bool _demo = DemoSingleton.Instance.Demo;
|
||||
|
||||
|
||||
public async Task<List<MultiSearchResult>> MultiSearch(string searchTerm, MultiSearchFilter filter, CancellationToken cancellationToken)
|
||||
{
|
||||
|
@ -60,6 +62,12 @@ namespace Ombi.Core.Engine.V2
|
|||
|
||||
foreach (var multiSearch in movieDbData)
|
||||
{
|
||||
|
||||
if (DemoCheck(multiSearch.title) || DemoCheck(multiSearch.name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var result = new MultiSearchResult
|
||||
{
|
||||
MediaType = multiSearch.media_type,
|
||||
|
|
|
@ -155,6 +155,10 @@ namespace Ombi.Core.Engine.V2
|
|||
|
||||
foreach (var tvMazeSearch in items)
|
||||
{
|
||||
if (DemoCheck(tvMazeSearch.Title))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (settings.HideAvailableFromDiscover)
|
||||
{
|
||||
// To hide, we need to know if it's fully available, the only way to do this is to lookup it's episodes to check if we have every episode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue