aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteItemRepository.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-04-02 22:15:18 +0200
committerBond_009 <bond.009@outlook.com>2019-06-28 12:14:27 +0200
commite88ebd748d98cf9bd2a3978d36254f1644ce751a (patch)
treee3316459f42b9c849dd17ebd33d06d646be0b9f3 /Emby.Server.Implementations/Data/SqliteItemRepository.cs
parentb6954f3bfd68c87923348444a5923406cf672f9b (diff)
Final fixes
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs40
1 files changed, 20 insertions, 20 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 9e96d7745..462d91e41 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -317,7 +317,7 @@ namespace Emby.Server.Implementations.Data
connection.RunQueries(postQueries);
}
- userDataRepo.Initialize(userManager);
+ userDataRepo.Initialize(userManager, WriteLock, WriteConnection);
}
private static readonly string[] _retriveItemColumns =
@@ -551,16 +551,16 @@ namespace Emby.Server.Implementations.Data
using (var connection = GetConnection())
{
- connection.RunInTransaction(db =>
+ connection.RunInTransaction((Action<IDatabaseConnection>)(db =>
{
- using (var saveImagesStatement = PrepareStatement(db, "Update TypedBaseItems set Images=@Images where guid=@Id"))
+ using (var saveImagesStatement = base.PrepareStatement((IDatabaseConnection)db, (string)"Update TypedBaseItems set Images=@Images where guid=@Id"))
{
saveImagesStatement.TryBind("@Id", item.Id.ToGuidBlob());
saveImagesStatement.TryBind("@Images", SerializeImages(item));
saveImagesStatement.MoveNext();
}
- }, TransactionMode);
+ }), TransactionMode);
}
}
@@ -1186,7 +1186,7 @@ namespace Emby.Server.Implementations.Data
using (var connection = GetConnection(true))
{
- using (var statement = PrepareStatementSafe(connection, "select " + string.Join(",", _retriveItemColumns) + " from TypedBaseItems where guid = @guid"))
+ using (var statement = PrepareStatement(connection, "select " + string.Join(",", _retriveItemColumns) + " from TypedBaseItems where guid = @guid"))
{
statement.TryBind("@guid", id);
@@ -1901,7 +1901,7 @@ namespace Emby.Server.Implementations.Data
{
var list = new List<ChapterInfo>();
- using (var statement = PrepareStatementSafe(connection, "select StartPositionTicks,Name,ImagePath,ImageDateModified from " + ChaptersTableName + " where ItemId = @ItemId order by ChapterIndex asc"))
+ using (var statement = PrepareStatement(connection, "select StartPositionTicks,Name,ImagePath,ImageDateModified from " + ChaptersTableName + " where ItemId = @ItemId order by ChapterIndex asc"))
{
statement.TryBind("@ItemId", item.Id);
@@ -1928,7 +1928,7 @@ namespace Emby.Server.Implementations.Data
using (var connection = GetConnection(true))
{
- using (var statement = PrepareStatementSafe(connection, "select StartPositionTicks,Name,ImagePath,ImageDateModified from " + ChaptersTableName + " where ItemId = @ItemId and ChapterIndex=@ChapterIndex"))
+ using (var statement = PrepareStatement(connection, "select StartPositionTicks,Name,ImagePath,ImageDateModified from " + ChaptersTableName + " where ItemId = @ItemId and ChapterIndex=@ChapterIndex"))
{
statement.TryBind("@ItemId", item.Id);
statement.TryBind("@ChapterIndex", index);
@@ -2028,7 +2028,7 @@ namespace Emby.Server.Implementations.Data
}
insertText.Length -= 1; // Remove last ,
- using (var statement = PrepareStatementSafe(db, insertText.ToString()))
+ using (var statement = PrepareStatement(db, insertText.ToString()))
{
statement.TryBind("@ItemId", idBlob);
@@ -2533,7 +2533,7 @@ namespace Emby.Server.Implementations.Data
using (var connection = GetConnection(true))
{
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
if (EnableJoinUserData(query))
{
@@ -2604,7 +2604,7 @@ namespace Emby.Server.Implementations.Data
{
var list = new List<BaseItem>();
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
if (EnableJoinUserData(query))
{
@@ -3054,7 +3054,7 @@ namespace Emby.Server.Implementations.Data
{
var list = new List<Guid>();
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
if (EnableJoinUserData(query))
{
@@ -3119,7 +3119,7 @@ namespace Emby.Server.Implementations.Data
var list = new List<Tuple<Guid, string>>();
using (var connection = GetConnection(true))
{
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
if (EnableJoinUserData(query))
{
@@ -4983,7 +4983,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
using (var connection = GetConnection(true))
{
var list = new List<string>();
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
// Run this again to bind the params
GetPeopleWhereClauses(query, statement);
@@ -5021,7 +5021,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
var list = new List<PersonInfo>();
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
// Run this again to bind the params
GetPeopleWhereClauses(query, statement);
@@ -5146,7 +5146,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
insertText.AppendFormat("(@ItemId, @AncestorId{0}, @AncestorIdText{0})", i.ToString(CultureInfo.InvariantCulture));
}
- using (var statement = PrepareStatementSafe(db, insertText.ToString()))
+ using (var statement = PrepareStatement(db, insertText.ToString()))
{
statement.TryBind("@ItemId", itemIdBlob);
@@ -5247,7 +5247,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
var list = new List<string>();
- using (var statement = PrepareStatementSafe(connection, commandText))
+ using (var statement = PrepareStatement(connection, commandText))
{
foreach (var row in statement.ExecuteQuery())
{
@@ -5651,7 +5651,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
isSubsequentRow = true;
}
- using (var statement = PrepareStatementSafe(db, insertText.ToString()))
+ using (var statement = PrepareStatement(db, insertText.ToString()))
{
statement.TryBind("@ItemId", idBlob);
@@ -5735,7 +5735,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
isSubsequentRow = true;
}
- using (var statement = PrepareStatementSafe(db, insertText.ToString()))
+ using (var statement = PrepareStatement(db, insertText.ToString()))
{
statement.TryBind("@ItemId", idBlob);
@@ -5817,7 +5817,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
{
var list = new List<MediaStream>();
- using (var statement = PrepareStatementSafe(connection, cmdText))
+ using (var statement = PrepareStatement(connection, cmdText))
{
statement.TryBind("@ItemId", query.ItemId.ToGuidBlob());
@@ -5902,7 +5902,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
insertText.Append(")");
}
- using (var statement = PrepareStatementSafe(db, insertText.ToString()))
+ using (var statement = PrepareStatement(db, insertText.ToString()))
{
statement.TryBind("@ItemId", idBlob);