mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 21:33:02 +02:00
update sqlite
This commit is contained in:
parent
6f88eb9aa6
commit
3950bbc013
|
@ -118,7 +118,7 @@ namespace MediaBrowser.Api
|
||||||
config.EnableStandaloneMusicKeys = true;
|
config.EnableStandaloneMusicKeys = true;
|
||||||
config.EnableCaseSensitiveItemIds = true;
|
config.EnableCaseSensitiveItemIds = true;
|
||||||
config.EnableFolderView = true;
|
config.EnableFolderView = true;
|
||||||
config.SchemaVersion = 95;
|
config.SchemaVersion = 96;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Post(UpdateStartupConfiguration request)
|
public void Post(UpdateStartupConfiguration request)
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
private IDbCommand _updateInheritedRatingCommand;
|
private IDbCommand _updateInheritedRatingCommand;
|
||||||
private IDbCommand _updateInheritedTagsCommand;
|
private IDbCommand _updateInheritedTagsCommand;
|
||||||
|
|
||||||
public const int LatestSchemaVersion = 95;
|
public const int LatestSchemaVersion = 96;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||||
|
@ -266,6 +266,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
_connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text");
|
_connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text");
|
||||||
_connection.AddColumn(Logger, "TypedBaseItems", "IsVirtualItem", "BIT");
|
_connection.AddColumn(Logger, "TypedBaseItems", "IsVirtualItem", "BIT");
|
||||||
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesName", "Text");
|
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesName", "Text");
|
||||||
|
_connection.AddColumn(Logger, "TypedBaseItems", "UserDataKey", "Text");
|
||||||
|
|
||||||
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
|
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
|
||||||
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
|
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
|
||||||
|
@ -510,7 +511,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
"DateLastMediaAdded",
|
"DateLastMediaAdded",
|
||||||
"Album",
|
"Album",
|
||||||
"IsVirtualItem",
|
"IsVirtualItem",
|
||||||
"SeriesName"
|
"SeriesName",
|
||||||
|
"UserDataKey"
|
||||||
};
|
};
|
||||||
_saveItemCommand = _connection.CreateCommand();
|
_saveItemCommand = _connection.CreateCommand();
|
||||||
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
||||||
|
@ -939,6 +941,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
_saveItemCommand.GetParameter(index++).Value = null;
|
_saveItemCommand.GetParameter(index++).Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.GetUserDataKeys().FirstOrDefault();
|
||||||
|
|
||||||
_saveItemCommand.Transaction = transaction;
|
_saveItemCommand.Transaction = transaction;
|
||||||
|
|
||||||
_saveItemCommand.ExecuteNonQuery();
|
_saveItemCommand.ExecuteNonQuery();
|
||||||
|
@ -1737,6 +1741,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_config.Configuration.SchemaVersion >= 96)
|
||||||
|
{
|
||||||
|
return " left join UserDataDb.UserData on UserDataKey=UserDataDb.UserData.Key And (UserId=@UserId)";
|
||||||
|
}
|
||||||
|
|
||||||
return " left join UserDataDb.UserData on (select UserDataKey from UserDataKeys where ItemId=Guid order by Priority LIMIT 1)=UserDataDb.UserData.Key And (UserId=@UserId)";
|
return " left join UserDataDb.UserData on (select UserDataKey from UserDataKeys where ItemId=Guid order by Priority LIMIT 1)=UserDataDb.UserData.Key And (UserId=@UserId)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1842,7 +1851,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
var slowThreshold = 1000;
|
var slowThreshold = 1000;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
slowThreshold = 60;
|
slowThreshold = 50;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (elapsed >= slowThreshold)
|
if (elapsed >= slowThreshold)
|
||||||
|
|
|
@ -336,18 +336,19 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
using (var cmd = _connection.CreateCommand())
|
using (var cmd = _connection.CreateCommand())
|
||||||
{
|
{
|
||||||
var index = 0;
|
var index = 0;
|
||||||
var excludeIds = new List<string>();
|
var userdataKeys = new List<string>();
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
foreach (var key in keys)
|
foreach (var key in keys)
|
||||||
{
|
{
|
||||||
var paramName = "@Key" + index;
|
var paramName = "@Key" + index;
|
||||||
excludeIds.Add("Key =" + paramName);
|
userdataKeys.Add("Key =" + paramName);
|
||||||
cmd.Parameters.Add(cmd, paramName, DbType.String).Value = key;
|
cmd.Parameters.Add(cmd, paramName, DbType.String).Value = key;
|
||||||
builder.Append(" WHEN Key=" + paramName + " THEN " + index);
|
builder.Append(" WHEN Key=" + paramName + " THEN " + index);
|
||||||
index++;
|
index++;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var keyText = string.Join(" OR ", excludeIds.ToArray());
|
var keyText = string.Join(" OR ", userdataKeys.ToArray());
|
||||||
|
|
||||||
cmd.CommandText = "select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where userId=@userId AND (" + keyText + ") ";
|
cmd.CommandText = "select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where userId=@userId AND (" + keyText + ") ";
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,8 @@
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.101.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite, Version=1.0.102.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Data.SQLite.Core.1.0.101.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
<HintPath>..\packages\System.Data.SQLite.Core.1.0.102.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
|
@ -1112,12 +1112,12 @@
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets')" />
|
<Import Project="..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets'))" />
|
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.102.0\build\net46\System.Data.SQLite.Core.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
<package id="CommonIO" version="1.0.0.9" targetFramework="net45" />
|
<package id="CommonIO" version="1.0.0.9" targetFramework="net45" />
|
||||||
<package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net45" />
|
<package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net45" />
|
||||||
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
|
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
|
||||||
<package id="System.Data.SQLite.Core" version="1.0.101.0" targetFramework="net46" />
|
<package id="System.Data.SQLite.Core" version="1.0.102.0" targetFramework="net46" />
|
||||||
</packages>
|
</packages>
|
Loading…
Reference in a new issue