mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Merge branch 'develop' of https://github.com/ombi-app/Ombi into develop
This commit is contained in:
commit
043eb08aa5
14 changed files with 79 additions and 40 deletions
|
@ -27,9 +27,12 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
var useTheMovieDb = false;
|
||||
var useId = false;
|
||||
var useTvDb = false;
|
||||
|
||||
PlexMediaTypeEntity type = ConvertType(obj.Type);
|
||||
|
||||
if (obj.ImdbId.HasValue())
|
||||
{
|
||||
item = await PlexContentRepository.Get(obj.ImdbId, ProviderType.ImdbId);
|
||||
item = await PlexContentRepository.GetByType(obj.ImdbId, ProviderType.ImdbId, type);
|
||||
if (item != null)
|
||||
{
|
||||
useImdb = true;
|
||||
|
@ -39,7 +42,7 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
{
|
||||
if (obj.Id > 0)
|
||||
{
|
||||
item = await PlexContentRepository.Get(obj.Id.ToString(), ProviderType.TheMovieDbId);
|
||||
item = await PlexContentRepository.GetByType(obj.Id.ToString(), ProviderType.TheMovieDbId, type);
|
||||
if (item != null)
|
||||
{
|
||||
useId = true;
|
||||
|
@ -47,7 +50,7 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
}
|
||||
if (obj.TheMovieDbId.HasValue())
|
||||
{
|
||||
item = await PlexContentRepository.Get(obj.TheMovieDbId, ProviderType.TheMovieDbId);
|
||||
item = await PlexContentRepository.GetByType(obj.TheMovieDbId, ProviderType.TheMovieDbId, type);
|
||||
if (item != null)
|
||||
{
|
||||
useTheMovieDb = true;
|
||||
|
@ -58,7 +61,7 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
{
|
||||
if (obj.TheTvDbId.HasValue())
|
||||
{
|
||||
item = await PlexContentRepository.Get(obj.TheTvDbId, ProviderType.TvDbId);
|
||||
item = await PlexContentRepository.GetByType(obj.TheTvDbId, ProviderType.TvDbId, type);
|
||||
if (item != null)
|
||||
{
|
||||
useTvDb = true;
|
||||
|
@ -100,6 +103,12 @@ namespace Ombi.Core.Rule.Rules.Search
|
|||
return Success();
|
||||
}
|
||||
|
||||
|
||||
private PlexMediaTypeEntity ConvertType(RequestType type) =>
|
||||
type switch
|
||||
{
|
||||
RequestType.Movie => PlexMediaTypeEntity.Movie,
|
||||
RequestType.TvShow => PlexMediaTypeEntity.Show,
|
||||
_ => PlexMediaTypeEntity.Movie,
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue