|
@@ -205,7 +205,7 @@ namespace Emby.Server.Implementations.Data
|
|
private static readonly string _mediaAttachmentSaveColumnsSelectQuery =
|
|
private static readonly string _mediaAttachmentSaveColumnsSelectQuery =
|
|
$"select {string.Join(',', _mediaAttachmentSaveColumns)} from mediaattachments where ItemId=@ItemId";
|
|
$"select {string.Join(',', _mediaAttachmentSaveColumns)} from mediaattachments where ItemId=@ItemId";
|
|
|
|
|
|
- private static readonly string _mediaAttachmentInsertPrefix;
|
|
|
|
|
|
+ private static readonly string _mediaAttachmentInsertPrefix = BuildMediaAttachmentInsertPrefix();
|
|
|
|
|
|
private static readonly BaseItemKind[] _programTypes = new[]
|
|
private static readonly BaseItemKind[] _programTypes = new[]
|
|
{
|
|
{
|
|
@@ -296,21 +296,6 @@ namespace Emby.Server.Implementations.Data
|
|
{ BaseItemKind.Year, typeof(Year).FullName }
|
|
{ BaseItemKind.Year, typeof(Year).FullName }
|
|
};
|
|
};
|
|
|
|
|
|
- static SqliteItemRepository()
|
|
|
|
- {
|
|
|
|
- var queryPrefixText = new StringBuilder();
|
|
|
|
- queryPrefixText.Append("insert into mediaattachments (");
|
|
|
|
- foreach (var column in _mediaAttachmentSaveColumns)
|
|
|
|
- {
|
|
|
|
- queryPrefixText.Append(column)
|
|
|
|
- .Append(',');
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- queryPrefixText.Length -= 1;
|
|
|
|
- queryPrefixText.Append(") values ");
|
|
|
|
- _mediaAttachmentInsertPrefix = queryPrefixText.ToString();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
|
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -5879,6 +5864,21 @@ AND Type = @InternalPersonType)");
|
|
return item;
|
|
return item;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static string BuildMediaAttachmentInsertPrefix()
|
|
|
|
+ {
|
|
|
|
+ var queryPrefixText = new StringBuilder();
|
|
|
|
+ queryPrefixText.Append("insert into mediaattachments (");
|
|
|
|
+ foreach (var column in _mediaAttachmentSaveColumns)
|
|
|
|
+ {
|
|
|
|
+ queryPrefixText.Append(column)
|
|
|
|
+ .Append(',');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ queryPrefixText.Length -= 1;
|
|
|
|
+ queryPrefixText.Append(") values ");
|
|
|
|
+ return queryPrefixText.ToString();
|
|
|
|
+ }
|
|
|
|
+
|
|
#nullable enable
|
|
#nullable enable
|
|
|
|
|
|
private readonly struct QueryTimeLogger : IDisposable
|
|
private readonly struct QueryTimeLogger : IDisposable
|