aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Activity/ActivityRepository.cs5
-rw-r--r--Emby.Server.Implementations/Data/BaseSqliteRepository.cs37
-rw-r--r--Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs5
-rw-r--r--Emby.Server.Implementations/Data/SqliteFileOrganizationRepository.cs5
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs96
-rw-r--r--Emby.Server.Implementations/Data/SqliteUserDataRepository.cs5
-rw-r--r--Emby.Server.Implementations/Data/SqliteUserRepository.cs5
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs16
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs31
-rw-r--r--Emby.Server.Implementations/Library/UserViewManager.cs30
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs2
-rw-r--r--Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs11
-rw-r--r--Emby.Server.Implementations/Security/AuthenticationRepository.cs5
-rw-r--r--Emby.Server.Implementations/Social/SharingRepository.cs5
-rw-r--r--Emby.Server.Implementations/Sync/SyncRepository.cs5
-rw-r--r--Emby.Server.Implementations/TV/TVSeriesManager.cs4
16 files changed, 146 insertions, 121 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs
index 8a7573d66..eef9792de 100644
--- a/Emby.Server.Implementations/Activity/ActivityRepository.cs
+++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs
@@ -29,10 +29,9 @@ namespace Emby.Server.Implementations.Activity
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
index 382c7f245..d4226ec25 100644
--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
@@ -40,6 +40,8 @@ namespace Emby.Server.Implementations.Data
private static bool _versionLogged;
+ private string _defaultWal;
+
protected SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false, Action<SQLiteDatabaseConnection> onConnect = null)
{
if (!_versionLogged)
@@ -51,6 +53,15 @@ namespace Emby.Server.Implementations.Data
ConnectionFlags connectionFlags;
+ if (isReadOnly)
+ {
+ //Logger.Info("Opening read connection");
+ }
+ else
+ {
+ //Logger.Info("Opening write connection");
+ }
+
isReadOnly = false;
if (isReadOnly)
@@ -70,12 +81,16 @@ namespace Emby.Server.Implementations.Data
var db = SQLite3.Open(DbFilePath, connectionFlags, null);
+ if (string.IsNullOrWhiteSpace(_defaultWal))
+ {
+ _defaultWal = db.Query("PRAGMA journal_mode").SelectScalarString().First();
+ }
+
var queries = new List<string>
{
+ "PRAGMA default_temp_store=memory",
"pragma temp_store = memory",
- "PRAGMA page_size=4096",
- "PRAGMA journal_mode=WAL",
- "pragma synchronous=Normal",
+ "PRAGMA journal_mode=WAL"
//"PRAGMA cache size=-10000"
};
@@ -90,13 +105,19 @@ namespace Emby.Server.Implementations.Data
//// db.Execute(query);
////}
- using (WriteLock.Write())
- {
- db.ExecuteAll(string.Join(";", queries.ToArray()));
+ //Logger.Info("synchronous: " + db.Query("PRAGMA synchronous").SelectScalarString().First());
+ //Logger.Info("temp_store: " + db.Query("PRAGMA temp_store").SelectScalarString().First());
- if (onConnect != null)
+ //if (!string.Equals(_defaultWal, "wal", StringComparison.OrdinalIgnoreCase) || onConnect != null)
+ {
+ using (WriteLock.Write())
{
- onConnect(db);
+ db.ExecuteAll(string.Join(";", queries.ToArray()));
+
+ if (onConnect != null)
+ {
+ onConnect(db);
+ }
}
}
diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
index ab927ce86..17afbcfa9 100644
--- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
@@ -56,10 +56,9 @@ namespace Emby.Server.Implementations.Data
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Data/SqliteFileOrganizationRepository.cs b/Emby.Server.Implementations/Data/SqliteFileOrganizationRepository.cs
index a71682329..efc0ee2ed 100644
--- a/Emby.Server.Implementations/Data/SqliteFileOrganizationRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteFileOrganizationRepository.cs
@@ -33,10 +33,9 @@ namespace Emby.Server.Implementations.Data
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 754af9640..bc1eca06a 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -29,6 +29,7 @@ using MediaBrowser.Server.Implementations.Devices;
using MediaBrowser.Server.Implementations.Playlists;
using MediaBrowser.Model.Reflection;
using SQLitePCL.pretty;
+using MediaBrowser.Model.System;
namespace Emby.Server.Implementations.Data
{
@@ -66,14 +67,14 @@ namespace Emby.Server.Implementations.Data
private readonly string _criticReviewsPath;
- public const int LatestSchemaVersion = 109;
private readonly IMemoryStreamFactory _memoryStreamProvider;
private readonly IFileSystem _fileSystem;
+ private readonly IEnvironmentInfo _environmentInfo;
/// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
/// </summary>
- public SqliteItemRepository(IServerConfigurationManager config, IJsonSerializer jsonSerializer, ILogger logger, IMemoryStreamFactory memoryStreamProvider, IAssemblyInfo assemblyInfo, IFileSystem fileSystem)
+ public SqliteItemRepository(IServerConfigurationManager config, IJsonSerializer jsonSerializer, ILogger logger, IMemoryStreamFactory memoryStreamProvider, IAssemblyInfo assemblyInfo, IFileSystem fileSystem, IEnvironmentInfo environmentInfo)
: base(logger)
{
if (config == null)
@@ -89,6 +90,7 @@ namespace Emby.Server.Implementations.Data
_jsonSerializer = jsonSerializer;
_memoryStreamProvider = memoryStreamProvider;
_fileSystem = fileSystem;
+ _environmentInfo = environmentInfo;
_typeMapper = new TypeMapper(assemblyInfo);
_criticReviewsPath = Path.Combine(_config.ApplicationPaths.DataPath, "critic-reviews");
@@ -129,10 +131,9 @@ namespace Emby.Server.Implementations.Data
_connection.ExecuteAll(string.Join(";", new[]
{
- "pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "PRAGMA page_size=4096",
+ "PRAGMA default_temp_store=memory",
+ "PRAGMA temp_store=memory"
}));
var createMediaStreamsTableCommand
@@ -193,7 +194,6 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "TypedBaseItems", "ProductionYear", "INT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "ParentId", "GUID", existingColumnNames);
AddColumn(db, "TypedBaseItems", "Genres", "Text", existingColumnNames);
- AddColumn(db, "TypedBaseItems", "SchemaVersion", "INT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);
@@ -205,7 +205,6 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames);
AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames);
- AddColumn(db, "TypedBaseItems", "IsOffline", "BIT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "LocationType", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "IsSeries", "BIT", existingColumnNames);
@@ -381,7 +380,6 @@ namespace Emby.Server.Implementations.Data
"data",
"StartDate",
"EndDate",
- "IsOffline",
"ChannelId",
"IsMovie",
"IsSports",
@@ -529,7 +527,6 @@ namespace Emby.Server.Implementations.Data
"ParentId",
"Genres",
"InheritedParentalRatingValue",
- "SchemaVersion",
"SortName",
"RunTimeTicks",
"OfficialRatingDescription",
@@ -539,7 +536,6 @@ namespace Emby.Server.Implementations.Data
"DateCreated",
"DateModified",
"ForcedSortName",
- "IsOffline",
"LocationType",
"PreferredMetadataLanguage",
"PreferredMetadataCountryCode",
@@ -790,7 +786,6 @@ namespace Emby.Server.Implementations.Data
}
saveItemStatement.TryBind("@InheritedParentalRatingValue", item.GetInheritedParentalRatingValue() ?? 0);
- saveItemStatement.TryBind("@SchemaVersion", LatestSchemaVersion);
saveItemStatement.TryBind("@SortName", item.SortName);
saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks);
@@ -803,7 +798,6 @@ namespace Emby.Server.Implementations.Data
saveItemStatement.TryBind("@DateModified", item.DateModified);
saveItemStatement.TryBind("@ForcedSortName", item.ForcedSortName);
- saveItemStatement.TryBind("@IsOffline", item.IsOffline);
saveItemStatement.TryBind("@LocationType", item.LocationType.ToString());
saveItemStatement.TryBind("@PreferredMetadataLanguage", item.PreferredMetadataLanguage);
@@ -1182,7 +1176,7 @@ namespace Emby.Server.Implementations.Data
}
CheckDisposed();
-
+ //Logger.Info("Retrieving item {0}", id.ToString("N"));
using (var connection = CreateConnection(true))
{
using (WriteLock.Read())
@@ -1369,64 +1363,72 @@ namespace Emby.Server.Implementations.Data
if (!reader.IsDBNull(4))
{
- item.IsOffline = reader.GetBoolean(4);
+ item.ChannelId = reader.GetString(4);
}
- if (!reader.IsDBNull(5))
- {
- item.ChannelId = reader.GetString(5);
- }
+ var index = 5;
var hasProgramAttributes = item as IHasProgramAttributes;
if (hasProgramAttributes != null)
{
- if (!reader.IsDBNull(6))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsMovie = reader.GetBoolean(6);
+ hasProgramAttributes.IsMovie = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(7))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsSports = reader.GetBoolean(7);
+ hasProgramAttributes.IsSports = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(8))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsKids = reader.GetBoolean(8);
+ hasProgramAttributes.IsKids = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(9))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsSeries = reader.GetBoolean(9);
+ hasProgramAttributes.IsSeries = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(10))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsLive = reader.GetBoolean(10);
+ hasProgramAttributes.IsLive = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(11))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsNews = reader.GetBoolean(11);
+ hasProgramAttributes.IsNews = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(12))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
+ hasProgramAttributes.IsPremiere = reader.GetBoolean(index);
}
+ index++;
- if (!reader.IsDBNull(13))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.EpisodeTitle = reader.GetString(13);
+ hasProgramAttributes.EpisodeTitle = reader.GetString(index);
}
+ index++;
- if (!reader.IsDBNull(14))
+ if (!reader.IsDBNull(index))
{
- hasProgramAttributes.IsRepeat = reader.GetBoolean(14);
+ hasProgramAttributes.IsRepeat = reader.GetBoolean(index);
}
+ index++;
+ }
+ else
+ {
+ index += 9;
}
-
- var index = 15;
if (!reader.IsDBNull(index))
{
@@ -2368,6 +2370,8 @@ namespace Emby.Server.Implementations.Data
CheckDisposed();
+ //Logger.Info("GetItemList: " + _environmentInfo.StackTrace);
+
var now = DateTime.UtcNow;
var list = new List<BaseItem>();
@@ -2533,6 +2537,7 @@ namespace Emby.Server.Implementations.Data
TotalRecordCount = returnList.Count
};
}
+ //Logger.Info("GetItems: " + _environmentInfo.StackTrace);
var now = DateTime.UtcNow;
@@ -2770,6 +2775,7 @@ namespace Emby.Server.Implementations.Data
}
CheckDisposed();
+ //Logger.Info("GetItemIdsList: " + _environmentInfo.StackTrace);
var now = DateTime.UtcNow;
@@ -2928,6 +2934,7 @@ namespace Emby.Server.Implementations.Data
TotalRecordCount = returnList.Count
};
}
+ //Logger.Info("GetItemIds: " + _environmentInfo.StackTrace);
var now = DateTime.UtcNow;
@@ -3053,14 +3060,6 @@ namespace Emby.Server.Implementations.Data
statement.TryBind("@IsLocked", query.IsLocked);
}
}
- if (query.IsOffline.HasValue)
- {
- whereClauses.Add("IsOffline=@IsOffline");
- if (statement != null)
- {
- statement.TryBind("@IsOffline", query.IsOffline);
- }
- }
var exclusiveProgramAttribtues = !(query.IsMovie ?? true) ||
!(query.IsSports ?? true) ||
@@ -4721,7 +4720,7 @@ namespace Emby.Server.Implementations.Data
using (var connection = CreateConnection(true))
{
- using (WriteLock.Write())
+ using (WriteLock.Read())
{
foreach (var row in connection.Query(commandText))
{
@@ -4750,6 +4749,7 @@ namespace Emby.Server.Implementations.Data
}
CheckDisposed();
+ //Logger.Info("GetItemValues: " + _environmentInfo.StackTrace);
var now = DateTime.UtcNow;
diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
index 0b4768c14..9f7cce13b 100644
--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
@@ -45,10 +45,9 @@ namespace Emby.Server.Implementations.Data
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Data/SqliteUserRepository.cs b/Emby.Server.Implementations/Data/SqliteUserRepository.cs
index 0a2f9e7cd..f902d981f 100644
--- a/Emby.Server.Implementations/Data/SqliteUserRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteUserRepository.cs
@@ -52,10 +52,9 @@ namespace Emby.Server.Implementations.Data
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index 85549439b..438fc55d7 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -482,7 +482,7 @@ namespace Emby.Server.Implementations.Dto
{
if (dtoOptions.EnableUserData)
{
- dto.UserData = _userDataRepository.GetUserDataDto(item, user).Result;
+ dto.UserData = await _userDataRepository.GetUserDataDto(item, user).ConfigureAwait(false);
}
}
@@ -1450,11 +1450,19 @@ namespace Emby.Server.Implementations.Dto
private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions options, BaseItem owner)
{
+ if (!item.SupportsInheritedParentImages)
+ {
+ return;
+ }
+
var logoLimit = options.GetImageLimit(ImageType.Logo);
var artLimit = options.GetImageLimit(ImageType.Art);
var thumbLimit = options.GetImageLimit(ImageType.Thumb);
var backdropLimit = options.GetImageLimit(ImageType.Backdrop);
+ // For now. Emby apps are not using this
+ artLimit = 0;
+
if (logoLimit == 0 && artLimit == 0 && thumbLimit == 0 && backdropLimit == 0)
{
return;
@@ -1515,6 +1523,12 @@ namespace Emby.Server.Implementations.Dto
}
isFirst = false;
+
+ if (!parent.SupportsInheritedParentImages)
+ {
+ break;
+ }
+
parent = parent.GetParent();
}
}
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 13c6485e5..283d193dd 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -339,11 +339,6 @@ namespace Emby.Server.Implementations.Library
{
throw new ArgumentNullException("item");
}
- RegisterItem(item.Id, item);
- }
-
- private void RegisterItem(Guid id, BaseItem item)
- {
if (item is IItemByName)
{
if (!(item is MusicArtist))
@@ -354,13 +349,13 @@ namespace Emby.Server.Implementations.Library
if (item.IsFolder)
{
- if (!(item is ICollectionFolder) && !(item is UserView) && !(item is Channel) && !(item is AggregateFolder))
- {
- if (item.SourceType != SourceType.Library)
- {
- return;
- }
- }
+ //if (!(item is ICollectionFolder) && !(item is UserView) && !(item is Channel) && !(item is AggregateFolder))
+ //{
+ // if (item.SourceType != SourceType.Library)
+ // {
+ // return;
+ // }
+ //}
}
else
{
@@ -370,7 +365,7 @@ namespace Emby.Server.Implementations.Library
}
}
- LibraryItemsCache.AddOrUpdate(id, item, delegate { return item; });
+ LibraryItemsCache.AddOrUpdate(item.Id, item, delegate { return item; });
}
public async Task DeleteItem(BaseItem item, DeleteOptions options)
@@ -822,7 +817,7 @@ namespace Emby.Server.Implementations.Library
return _userRootFolder;
}
-
+
public BaseItem FindByPath(string path, bool? isFolder)
{
// If this returns multiple items it could be tricky figuring out which one is correct.
@@ -836,7 +831,7 @@ namespace Emby.Server.Implementations.Library
SortOrder = SortOrder.Descending,
Limit = 1
};
-
+
return GetItemList(query)
.FirstOrDefault();
}
@@ -1273,10 +1268,8 @@ namespace Emby.Server.Implementations.Library
return ItemRepository.GetItemList(query);
}
- public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, IEnumerable<string> parentIds)
+ public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, List<BaseItem> parents)
{
- var parents = parentIds.Select(i => GetItemById(new Guid(i))).Where(i => i != null).ToList();
-
SetTopParentIdsOrAncestors(query, parents);
if (query.AncestorIds.Length == 0 && query.TopParentIds.Length == 0)
@@ -1536,7 +1529,7 @@ namespace Emby.Server.Implementations.Library
}
// Handle grouping
- if (user != null && !string.IsNullOrWhiteSpace(view.ViewType) && UserView.IsEligibleForGrouping(view.ViewType))
+ if (user != null && !string.IsNullOrWhiteSpace(view.ViewType) && UserView.IsEligibleForGrouping(view.ViewType) && user.Configuration.GroupedFolders.Length > 0)
{
return user.RootFolder
.GetChildren(user, true)
diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs
index b93f565a3..f7cc8bb73 100644
--- a/Emby.Server.Implementations/Library/UserViewManager.cs
+++ b/Emby.Server.Implementations/Library/UserViewManager.cs
@@ -245,20 +245,26 @@ namespace Emby.Server.Implementations.Library
var includeItemTypes = request.IncludeItemTypes;
var limit = request.Limit ?? 10;
- var parentIds = string.IsNullOrEmpty(parentId)
- ? new string[] { }
- : new[] { parentId };
+ var parents = new List<BaseItem>();
- if (parentIds.Length == 0)
+ if (!string.IsNullOrWhiteSpace(parentId))
{
- parentIds = user.RootFolder.GetChildren(user, true)
- .OfType<Folder>()
- .Select(i => i.Id.ToString("N"))
- .Where(i => !user.Configuration.LatestItemsExcludes.Contains(i))
- .ToArray();
+ var parent = _libraryManager.GetItemById(parentId) as Folder;
+ if (parent != null)
+ {
+ parents.Add(parent);
+ }
+ }
+
+ if (parents.Count == 0)
+ {
+ parents = user.RootFolder.GetChildren(user, true)
+ .Where(i => i is Folder)
+ .Where(i => !user.Configuration.LatestItemsExcludes.Contains(i.Id.ToString("N")))
+ .ToList();
}
- if (parentIds.Length == 0)
+ if (parents.Count == 0)
{
return new List<BaseItem>();
}
@@ -283,10 +289,10 @@ namespace Emby.Server.Implementations.Library
ExcludeItemTypes = excludeItemTypes,
ExcludeLocationTypes = new[] { LocationType.Virtual },
Limit = limit * 5,
- SourceTypes = parentIds.Length == 0 ? new[] { SourceType.Library } : new SourceType[] { },
+ SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
IsPlayed = request.IsPlayed
- }, parentIds);
+ }, parents);
}
}
}
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 3a6f23fe9..faf9687f4 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -491,7 +491,7 @@ namespace Emby.Server.Implementations.LiveTv
var id = _tvDtoService.GetInternalChannelId(serviceName, channelInfo.Id);
- var item = _itemRepo.RetrieveItem(id) as LiveTvChannel;
+ var item = _libraryManager.GetItemById(id) as LiveTvChannel;
if (item == null)
{
diff --git a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
index 5fc691527..66ef5d5d1 100644
--- a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
+++ b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
@@ -31,10 +31,9 @@ namespace Emby.Server.Implementations.Notifications
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
@@ -57,9 +56,9 @@ namespace Emby.Server.Implementations.Notifications
{
var result = new NotificationResult();
- using (WriteLock.Read())
+ using (var connection = CreateConnection(true))
{
- using (var connection = CreateConnection(true))
+ //using (WriteLock.Read())
{
var clauses = new List<string>();
var paramList = new List<object>();
@@ -114,7 +113,7 @@ namespace Emby.Server.Implementations.Notifications
using (var connection = CreateConnection(true))
{
- using (WriteLock.Read())
+ //using (WriteLock.Read())
{
using (var statement = connection.PrepareStatement("select Level from Notifications where UserId=@UserId and IsRead=@IsRead"))
{
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs
index 0a598e9a7..dad05718c 100644
--- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs
+++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs
@@ -32,10 +32,9 @@ namespace Emby.Server.Implementations.Security
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Social/SharingRepository.cs b/Emby.Server.Implementations/Social/SharingRepository.cs
index e0ee62780..6dab54bc6 100644
--- a/Emby.Server.Implementations/Social/SharingRepository.cs
+++ b/Emby.Server.Implementations/Social/SharingRepository.cs
@@ -29,10 +29,9 @@ namespace Emby.Server.Implementations.Social
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/Sync/SyncRepository.cs b/Emby.Server.Implementations/Sync/SyncRepository.cs
index 36558142b..308c3bd00 100644
--- a/Emby.Server.Implementations/Sync/SyncRepository.cs
+++ b/Emby.Server.Implementations/Sync/SyncRepository.cs
@@ -45,10 +45,9 @@ namespace Emby.Server.Implementations.Sync
{
connection.ExecuteAll(string.Join(";", new[]
{
+ "PRAGMA page_size=4096",
"pragma default_temp_store = memory",
- "pragma default_synchronous=Normal",
- "pragma temp_store = memory",
- "pragma synchronous=Normal",
+ "pragma temp_store = memory"
}));
string[] queries = {
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs
index a47aaa305..fd576e081 100644
--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs
+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs
@@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.TV
return GetResult(episodes, null, request);
}
- public QueryResult<BaseItem> GetNextUp(NextUpQuery request, IEnumerable<Folder> parentsFolders)
+ public QueryResult<BaseItem> GetNextUp(NextUpQuery request, List<Folder> parentsFolders)
{
var user = _userManager.GetUserById(request.UserId);
@@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.TV
PresentationUniqueKey = presentationUniqueKey,
Limit = limit
- }, parentsFolders.Select(i => i.Id.ToString("N"))).Cast<Series>();
+ }, parentsFolders.Cast<BaseItem>().ToList()).Cast<Series>();
// Avoid implicitly captured closure
var episodes = GetNextUpEpisodes(request, user, items);