mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 04:18:06 +02:00
update provider id queries
This commit is contained in:
parent
2979185d8e
commit
e50a74e35b
1 changed files with 8 additions and 5 deletions
|
@ -2739,7 +2739,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
foreach (var pair in query.ExcludeProviderIds)
|
foreach (var pair in query.ExcludeProviderIds)
|
||||||
{
|
{
|
||||||
var paramName = "@ExcludeProviderId" + index;
|
var paramName = "@ExcludeProviderId" + index;
|
||||||
excludeIds.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Imdb'), '') <> "+ paramName + ")");
|
excludeIds.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Imdb'), '') <> " + paramName + ")");
|
||||||
cmd.Parameters.Add(cmd, paramName, DbType.String).Value = pair.Value;
|
cmd.Parameters.Add(cmd, paramName, DbType.String).Value = pair.Value;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
@ -2749,17 +2749,20 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
|
|
||||||
if (query.HasImdbId.HasValue)
|
if (query.HasImdbId.HasValue)
|
||||||
{
|
{
|
||||||
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Imdb'), '') <> '')");
|
var fn = query.HasImdbId.Value ? "<>" : "=";
|
||||||
|
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Imdb'), '') " + fn + " '')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.HasTmdbId.HasValue)
|
if (query.HasTmdbId.HasValue)
|
||||||
{
|
{
|
||||||
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Tmdb'), '') <> '')");
|
var fn = query.HasTmdbId.Value ? "<>" : "=";
|
||||||
|
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Tmdb'), '') " + fn + " '')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.HasTvdbId.HasValue)
|
if (query.HasTvdbId.HasValue)
|
||||||
{
|
{
|
||||||
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Tvdb'), '') <> '')");
|
var fn = query.HasTvdbId.Value ? "<>" : "=";
|
||||||
|
whereClauses.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = 'Tvdb'), '') " + fn + " '')");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.AlbumNames.Length > 0)
|
if (query.AlbumNames.Length > 0)
|
||||||
|
@ -3393,7 +3396,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateProviderIds(Guid itemId, Dictionary<string,string> values, IDbTransaction transaction)
|
private void UpdateProviderIds(Guid itemId, Dictionary<string, string> values, IDbTransaction transaction)
|
||||||
{
|
{
|
||||||
if (itemId == Guid.Empty)
|
if (itemId == Guid.Empty)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue