Refactor Emby and Jellyfin provider ids

This commit is contained in:
Florian Dupret 2022-02-05 09:49:26 +01:00
commit 7b13994359
6 changed files with 43 additions and 44 deletions

View file

@ -1,27 +1,11 @@
namespace Ombi.Api.Emby.Models.Movie using Ombi.Api.MediaServer.Models;
{
public class EmbyProviderids
{
public string Tmdb { get; set; }
public string Imdb { get; set; }
public string TmdbCollection { get; set; }
public string Tvdb { get; set; } namespace Ombi.Api.Emby.Models.Movie
{
public class EmbyProviderids: BaseProviderids
{
public string TmdbCollection { get; set; }
public string Zap2It { get; set; } public string Zap2It { get; set; }
public string TvRage { get; set; } public string TvRage { get; set; }
public bool Any()
{
if (string.IsNullOrEmpty(Imdb)
&& string.IsNullOrEmpty(Tmdb)
&& string.IsNullOrEmpty(Tvdb))
{
return true;
}
else
{
return false;
}
}
} }
} }

View file

@ -12,6 +12,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" /> <ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
<ProjectReference Include="..\Ombi.Api.MediaServer\Ombi.Api.MediaServer.csproj" />
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" /> <ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -1,27 +1,11 @@
namespace Ombi.Api.Jellyfin.Models.Movie using Ombi.Api.MediaServer.Models;
{
public class JellyfinProviderids
{
public string Tmdb { get; set; }
public string Imdb { get; set; }
public string TmdbCollection { get; set; }
public string Tvdb { get; set; } namespace Ombi.Api.Jellyfin.Models.Movie
{
public class JellyfinProviderids: BaseProviderids
{
public string TmdbCollection { get; set; }
public string Zap2It { get; set; } public string Zap2It { get; set; }
public string TvRage { get; set; } public string TvRage { get; set; }
public bool Any()
{
if (string.IsNullOrEmpty(Imdb)
&& string.IsNullOrEmpty(Tmdb)
&& string.IsNullOrEmpty(Tvdb))
{
return true;
}
else
{
return false;
}
}
} }
} }

View file

@ -13,6 +13,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" /> <ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" /> <ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
<ProjectReference Include="..\Ombi.Api.MediaServer\Ombi.Api.MediaServer.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -0,0 +1,11 @@
namespace Ombi.Api.MediaServer.Models
{
public class BaseProviderids
{
public string Tmdb { get; set; }
public string Imdb { get; set; }
public string Tvdb { get; set; }
public bool Any() =>
!string.IsNullOrEmpty(Imdb) || !string.IsNullOrEmpty(Tmdb) || !string.IsNullOrEmpty(Tvdb);
}
}

View file

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<Version></Version>
<PackageVersion></PackageVersion>
<LangVersion>8.0</LangVersion>
<Configurations>Debug;Release;NonUiBuild</Configurations>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
</ItemGroup>
</Project>