From d1190c52155bd1b487b9f2d39c4e94d0bf8857b2 Mon Sep 17 00:00:00 2001 From: cvium Date: Mon, 21 Aug 2023 22:12:08 +0200 Subject: [PATCH] fix userdata table not being committed --- .../Data/SqliteUserDataRepository.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs index f7c4be3980..a5edcc58c0 100644 --- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs @@ -45,10 +45,9 @@ namespace Emby.Server.Implementations.Data var users = userDatasTableExists ? null : _userManager.Users; using var transaction = connection.BeginTransaction(); - connection.Execute(string.Join(';', new[] - { + connection.Execute(string.Join( + ';', "create table if not exists UserDatas (key nvarchar not null, userId INT not null, rating float null, played bit not null, playCount int not null, isFavorite bit not null, playbackPositionTicks bigint not null, lastPlayedDate datetime null, AudioStreamIndex INT, SubtitleStreamIndex INT)", - "drop index if exists idx_userdata", "drop index if exists idx_userdata1", "drop index if exists idx_userdata2", @@ -59,11 +58,11 @@ namespace Emby.Server.Implementations.Data "create unique index if not exists UserDatasIndex1 on UserDatas (key, userId)", "create index if not exists UserDatasIndex2 on UserDatas (key, userId, played)", "create index if not exists UserDatasIndex3 on UserDatas (key, userId, playbackPositionTicks)", - "create index if not exists UserDatasIndex4 on UserDatas (key, userId, isFavorite)" - })); + "create index if not exists UserDatasIndex4 on UserDatas (key, userId, isFavorite)")); if (!userDataTableExists) { + transaction.Commit(); return; }