@ -549,7 +549,7 @@ namespace Emby.Server.Implementations.Data
{
using ( var saveImagesStatement = base . PrepareStatement ( db , "Update TypedBaseItems set Images=@Images where guid=@Id" ) )
{
saveImagesStatement . TryBind ( "@Id" , item . Id . To GuidBlob ( ) ) ;
saveImagesStatement . TryBind ( "@Id" , item . Id . To ByteArray ( ) ) ;
saveImagesStatement . TryBind ( "@Images" , SerializeImages ( item ) ) ;
saveImagesStatement . MoveNext ( ) ;
@ -1989,7 +1989,7 @@ namespace Emby.Server.Implementations.Data
throw new ArgumentNullException ( nameof ( chapters ) ) ;
}
var idBlob = id . To GuidBlob ( ) ;
var idBlob = id . To ByteArray ( ) ;
using ( var connection = GetConnection ( ) )
{
@ -3768,7 +3768,7 @@ namespace Emby.Server.Implementations.Data
if ( statement ! = null )
{
statement . TryBind ( paramName , personId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , personId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -3979,7 +3979,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "(guid in (select itemid from itemvalues where CleanValue = (select CleanName from TypedBaseItems where guid=" + paramName + ") and Type<=1))" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , artistId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , artistId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -3998,7 +3998,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "(guid in (select itemid from itemvalues where CleanValue = (select CleanName from TypedBaseItems where guid=" + paramName + ") and Type=1))" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , artistId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , artistId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4017,7 +4017,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "((select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type=0) AND (select CleanName from TypedBaseItems where guid=" + paramName + ") not in (select CleanValue from itemvalues where ItemId=Guid and Type=1))" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , artistId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , artistId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4036,7 +4036,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "Album in (select Name from typedbaseitems where guid=" + paramName + ")" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , albumId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , albumId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4055,7 +4055,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "(guid not in (select itemid from itemvalues where CleanValue = (select CleanName from TypedBaseItems where guid=" + paramName + ") and Type<=1))" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , artistId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , artistId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4074,7 +4074,7 @@ namespace Emby.Server.Implementations.Data
clauses . Add ( "(guid in (select itemid from itemvalues where CleanValue = (select CleanName from TypedBaseItems where guid=" + paramName + ") and Type=2))" ) ;
if ( statement ! = null )
{
statement . TryBind ( paramName , genreId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , genreId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4145,7 +4145,7 @@ namespace Emby.Server.Implementations.Data
if ( statement ! = null )
{
statement . TryBind ( paramName , studioId . To GuidBlob ( ) ) ;
statement . TryBind ( paramName , studioId . To ByteArray ( ) ) ;
}
index + + ;
}
@ -4921,7 +4921,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
connection . RunInTransaction ( db = >
{
var idBlob = id . To GuidBlob ( ) ;
var idBlob = id . To ByteArray ( ) ;
// Delete people
ExecuteWithSingleParam ( db , "delete from People where ItemId=@Id" , idBlob ) ;
@ -5040,7 +5040,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
whereClauses . Add ( "ItemId=@ItemId" ) ;
if ( statement ! = null )
{
statement . TryBind ( "@ItemId" , query . ItemId . To GuidBlob ( ) ) ;
statement . TryBind ( "@ItemId" , query . ItemId . To ByteArray ( ) ) ;
}
}
if ( ! query . AppearsInItemId . Equals ( Guid . Empty ) )
@ -5048,7 +5048,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
whereClauses . Add ( "Name in (Select Name from People where ItemId=@AppearsInItemId)" ) ;
if ( statement ! = null )
{
statement . TryBind ( "@AppearsInItemId" , query . AppearsInItemId . To GuidBlob ( ) ) ;
statement . TryBind ( "@AppearsInItemId" , query . AppearsInItemId . To ByteArray ( ) ) ;
}
}
var queryPersonTypes = query . PersonTypes . Where ( IsValidPersonType ) . ToList ( ) ;
@ -5117,7 +5117,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
CheckDisposed ( ) ;
var itemIdBlob = itemId . To GuidBlob ( ) ;
var itemIdBlob = itemId . To ByteArray ( ) ;
// First delete
deleteAncestorsStatement . Reset ( ) ;
@ -5151,7 +5151,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
var ancestorId = ancestorIds [ i ] ;
statement . TryBind ( "@AncestorId" + index , ancestorId . To GuidBlob ( ) ) ;
statement . TryBind ( "@AncestorId" + index , ancestorId . To ByteArray ( ) ) ;
statement . TryBind ( "@AncestorIdText" + index , ancestorId . ToString ( "N" , CultureInfo . InvariantCulture ) ) ;
}
@ -5616,7 +5616,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
CheckDisposed ( ) ;
var guidBlob = itemId . To GuidBlob ( ) ;
var guidBlob = itemId . To ByteArray ( ) ;
// First delete
db . Execute ( "delete from ItemValues where ItemId=@Id" , guidBlob ) ;
@ -5640,10 +5640,13 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
if ( isSubsequentRow )
{
insertText . Append ( "," ) ;
insertText . Append ( ',' ) ;
}
insertText . AppendFormat ( "(@ItemId, @Type{0}, @Value{0}, @CleanValue{0})" , i . ToString ( CultureInfo . InvariantCulture ) ) ;
insertText . AppendFormat (
CultureInfo . InvariantCulture ,
"(@ItemId, @Type{0}, @Value{0}, @CleanValue{0})" ,
i ) ;
isSubsequentRow = true ;
}
@ -5696,7 +5699,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
connection . RunInTransaction ( db = >
{
var itemIdBlob = itemId . To GuidBlob ( ) ;
var itemIdBlob = itemId . To ByteArray ( ) ;
// First delete chapters
db . Execute ( "delete from People where ItemId=@ItemId" , itemIdBlob ) ;
@ -5815,7 +5818,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
using ( var statement = PrepareStatement ( connection , cmdText ) )
{
statement . TryBind ( "@ItemId" , query . ItemId . To GuidBlob ( ) ) ;
statement . TryBind ( "@ItemId" , query . ItemId . To ByteArray ( ) ) ;
if ( query . Type . HasValue )
{
@ -5857,7 +5860,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
connection . RunInTransaction ( db = >
{
var itemIdBlob = id . To GuidBlob ( ) ;
var itemIdBlob = id . To ByteArray ( ) ;
// First delete chapters
db . Execute ( "delete from mediastreams where ItemId=@ItemId" , itemIdBlob ) ;