@ -199,10 +199,11 @@ namespace Emby.Server.Implementations.Data
AddColumn ( db , "TypedBaseItems" , "ParentId" , "GUID" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "ParentId" , "GUID" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "Genres" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "Genres" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "SortName" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "SortName" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "ForcedSortName" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "RunTimeTicks" , "BIGINT" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "RunTimeTicks" , "BIGINT" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "HomePageUrl" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "HomePageUrl" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "VoteCount" , "INT" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DisplayMediaType" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DisplayMediaType" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DateCreated" , "DATETIME" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DateCreated" , "DATETIME" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DateModified" , "DATETIME" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "DateModified" , "DATETIME" , existingColumnNames ) ;
@ -233,7 +234,6 @@ namespace Emby.Server.Implementations.Data
AddColumn ( db , "TypedBaseItems" , "UnratedType" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "UnratedType" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "TopParentId" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "TopParentId" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "IsItemByName" , "BIT" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "IsItemByName" , "BIT" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "SourceType" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "TrailerTypes" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "TrailerTypes" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "CriticRating" , "Float" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "CriticRating" , "Float" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "InheritedTags" , "Text" , existingColumnNames ) ;
AddColumn ( db , "TypedBaseItems" , "InheritedTags" , "Text" , existingColumnNames ) ;
@ -424,9 +424,8 @@ namespace Emby.Server.Implementations.Data
"OfficialRating" ,
"OfficialRating" ,
"HomePageUrl" ,
"HomePageUrl" ,
"DisplayMediaType" ,
"DisplayMediaType" ,
" SortName",
" Forced SortName",
"RunTimeTicks" ,
"RunTimeTicks" ,
"VoteCount" ,
"DateCreated" ,
"DateCreated" ,
"DateModified" ,
"DateModified" ,
"guid" ,
"guid" ,
@ -439,7 +438,6 @@ namespace Emby.Server.Implementations.Data
"LockedFields" ,
"LockedFields" ,
"Studios" ,
"Studios" ,
"Tags" ,
"Tags" ,
"SourceType" ,
"TrailerTypes" ,
"TrailerTypes" ,
"OriginalTitle" ,
"OriginalTitle" ,
"PrimaryVersionId" ,
"PrimaryVersionId" ,
@ -541,9 +539,9 @@ namespace Emby.Server.Implementations.Data
"Genres" ,
"Genres" ,
"InheritedParentalRatingValue" ,
"InheritedParentalRatingValue" ,
"SortName" ,
"SortName" ,
"ForcedSortName" ,
"RunTimeTicks" ,
"RunTimeTicks" ,
"HomePageUrl" ,
"HomePageUrl" ,
"VoteCount" ,
"DisplayMediaType" ,
"DisplayMediaType" ,
"DateCreated" ,
"DateCreated" ,
"DateModified" ,
"DateModified" ,
@ -563,7 +561,6 @@ namespace Emby.Server.Implementations.Data
"UnratedType" ,
"UnratedType" ,
"TopParentId" ,
"TopParentId" ,
"IsItemByName" ,
"IsItemByName" ,
"SourceType" ,
"TrailerTypes" ,
"TrailerTypes" ,
"CriticRating" ,
"CriticRating" ,
"InheritedTags" ,
"InheritedTags" ,
@ -815,10 +812,12 @@ namespace Emby.Server.Implementations.Data
saveItemStatement . TryBind ( "@InheritedParentalRatingValue" , item . InheritedParentalRatingValue ) ;
saveItemStatement . TryBind ( "@InheritedParentalRatingValue" , item . InheritedParentalRatingValue ) ;
saveItemStatement . TryBind ( "@SortName" , item . SortName ) ;
saveItemStatement . TryBind ( "@SortName" , item . SortName ) ;
saveItemStatement . TryBind ( "@ForcedSortName" , item . ForcedSortName ) ;
saveItemStatement . TryBind ( "@RunTimeTicks" , item . RunTimeTicks ) ;
saveItemStatement . TryBind ( "@RunTimeTicks" , item . RunTimeTicks ) ;
saveItemStatement . TryBind ( "@HomePageUrl" , item . HomePageUrl ) ;
saveItemStatement . TryBind ( "@HomePageUrl" , item . HomePageUrl ) ;
saveItemStatement . TryBind ( "@VoteCount" , item . VoteCount ) ;
saveItemStatement . TryBind ( "@DisplayMediaType" , item . DisplayMediaType ) ;
saveItemStatement . TryBind ( "@DisplayMediaType" , item . DisplayMediaType ) ;
saveItemStatement . TryBind ( "@DateCreated" , item . DateCreated ) ;
saveItemStatement . TryBind ( "@DateCreated" , item . DateCreated ) ;
saveItemStatement . TryBind ( "@DateModified" , item . DateModified ) ;
saveItemStatement . TryBind ( "@DateModified" , item . DateModified ) ;
@ -909,7 +908,6 @@ namespace Emby.Server.Implementations.Data
isByName = dualAccess = = null | | dualAccess . IsAccessedByName ;
isByName = dualAccess = = null | | dualAccess . IsAccessedByName ;
}
}
saveItemStatement . TryBind ( "@IsItemByName" , isByName ) ;
saveItemStatement . TryBind ( "@IsItemByName" , isByName ) ;
saveItemStatement . TryBind ( "@SourceType" , item . SourceType . ToString ( ) ) ;
var trailer = item as Trailer ;
var trailer = item as Trailer ;
if ( trailer ! = null & & trailer . TrailerTypes . Count > 0 )
if ( trailer ! = null & & trailer . TrailerTypes . Count > 0 )
@ -1624,7 +1622,7 @@ namespace Emby.Server.Implementations.Data
{
{
if ( ! reader . IsDBNull ( index ) )
if ( ! reader . IsDBNull ( index ) )
{
{
item . SortName = reader . GetString ( index ) ;
item . Forced SortName = reader . GetString ( index ) ;
}
}
index + + ;
index + + ;
}
}
@ -1635,15 +1633,6 @@ namespace Emby.Server.Implementations.Data
}
}
index + + ;
index + + ;
if ( HasField ( query , ItemFields . VoteCount ) )
{
if ( ! reader . IsDBNull ( index ) )
{
item . VoteCount = reader . GetInt32 ( index ) ;
}
index + + ;
}
if ( HasField ( query , ItemFields . DateCreated ) )
if ( HasField ( query , ItemFields . DateCreated ) )
{
{
if ( ! reader . IsDBNull ( index ) )
if ( ! reader . IsDBNull ( index ) )
@ -1733,12 +1722,6 @@ namespace Emby.Server.Implementations.Data
index + + ;
index + + ;
}
}
if ( ! reader . IsDBNull ( index ) )
{
item . SourceType = ( SourceType ) Enum . Parse ( typeof ( SourceType ) , reader . GetString ( index ) , true ) ;
}
index + + ;
if ( hasTrailerTypes )
if ( hasTrailerTypes )
{
{
var trailer = item as Trailer ;
var trailer = item as Trailer ;
@ -2283,7 +2266,7 @@ namespace Emby.Server.Implementations.Data
}
}
if ( field = = ItemFields . SortName )
if ( field = = ItemFields . SortName )
{
{
return new [ ] { " SortName" } ;
return new [ ] { " Forced SortName" } ;
}
}
if ( field = = ItemFields . Taglines )
if ( field = = ItemFields . Taglines )
{
{
@ -2306,7 +2289,6 @@ namespace Emby.Server.Implementations.Data
case ItemFields . HomePageUrl :
case ItemFields . HomePageUrl :
case ItemFields . Keywords :
case ItemFields . Keywords :
case ItemFields . DisplayMediaType :
case ItemFields . DisplayMediaType :
case ItemFields . VoteCount :
case ItemFields . CustomRating :
case ItemFields . CustomRating :
case ItemFields . ProductionLocations :
case ItemFields . ProductionLocations :
case ItemFields . Settings :
case ItemFields . Settings :
@ -3872,34 +3854,6 @@ namespace Emby.Server.Implementations.Data
}
}
}
}
if ( query . SourceTypes . Length = = 1 )
{
whereClauses . Add ( "SourceType=@SourceType" ) ;
if ( statement ! = null )
{
statement . TryBind ( "@SourceType" , query . SourceTypes [ 0 ] . ToString ( ) ) ;
}
}
else if ( query . SourceTypes . Length > 1 )
{
var inClause = string . Join ( "," , query . SourceTypes . Select ( i = > "'" + i + "'" ) . ToArray ( ) ) ;
whereClauses . Add ( string . Format ( "SourceType in ({0})" , inClause ) ) ;
}
if ( query . ExcludeSourceTypes . Length = = 1 )
{
whereClauses . Add ( "SourceType<>@ExcludeSourceTypes" ) ;
if ( statement ! = null )
{
statement . TryBind ( "@ExcludeSourceTypes" , query . ExcludeSourceTypes [ 0 ] . ToString ( ) ) ;
}
}
else if ( query . ExcludeSourceTypes . Length > 1 )
{
var inClause = string . Join ( "," , query . ExcludeSourceTypes . Select ( i = > "'" + i + "'" ) . ToArray ( ) ) ;
whereClauses . Add ( string . Format ( "SourceType not in ({0})" , inClause ) ) ;
}
if ( query . TrailerTypes . Length > 0 )
if ( query . TrailerTypes . Length > 0 )
{
{
var clauses = new List < string > ( ) ;
var clauses = new List < string > ( ) ;
@ -5017,14 +4971,6 @@ namespace Emby.Server.Implementations.Data
statement . TryBind ( "@NameContains" , "%" + query . NameContains + "%" ) ;
statement . TryBind ( "@NameContains" , "%" + query . NameContains + "%" ) ;
}
}
}
}
if ( query . SourceTypes . Length = = 1 )
{
whereClauses . Add ( "(select sourcetype from typedbaseitems where guid=ItemId) = @SourceTypes" ) ;
if ( statement ! = null )
{
statement . TryBind ( "@SourceTypes" , query . SourceTypes [ 0 ] . ToString ( ) ) ;
}
}
return whereClauses ;
return whereClauses ;
}
}