aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-08-05 10:58:22 -0400
committerBond_009 <bond.009@outlook.com>2024-08-05 10:58:22 -0400
commit22d8528d904e69a8e22ba0e6d43dcb58a54bdcf5 (patch)
tree66ee833b499e5ca4d1f1b55e316a2060081a0773 /MediaBrowser.Controller
parentd5fdb9c3a728ff8204c14c171ee4bdb3c992b02f (diff)
Backport pull request #11901 from jellyfin/release-10.9.z
Implement Device Cache to replace EFCoreSecondLevelCacheInterceptor Original-merge: b7bc0e1c96553675a490c0bd92a58ad9c5f0d0e1 Merged-by: joshuaboniface <joshua@boniface.me> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Devices/IDeviceManager.cs12
-rw-r--r--MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs15
2 files changed, 7 insertions, 20 deletions
diff --git a/MediaBrowser.Controller/Devices/IDeviceManager.cs b/MediaBrowser.Controller/Devices/IDeviceManager.cs
index eb181dcc4..5566421cb 100644
--- a/MediaBrowser.Controller/Devices/IDeviceManager.cs
+++ b/MediaBrowser.Controller/Devices/IDeviceManager.cs
@@ -44,26 +44,28 @@ namespace MediaBrowser.Controller.Devices
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>DeviceInfo.</returns>
- Task<DeviceInfo> GetDevice(string id);
+ DeviceInfo GetDevice(string id);
/// <summary>
/// Gets devices based on the provided query.
/// </summary>
/// <param name="query">The device query.</param>
/// <returns>A <see cref="Task{QueryResult}"/> representing the retrieval of the devices.</returns>
- Task<QueryResult<Device>> GetDevices(DeviceQuery query);
+ QueryResult<Device> GetDevices(DeviceQuery query);
- Task<QueryResult<DeviceInfo>> GetDeviceInfos(DeviceQuery query);
+ QueryResult<DeviceInfo> GetDeviceInfos(DeviceQuery query);
/// <summary>
/// Gets the devices.
/// </summary>
/// <param name="userId">The user's id, or <c>null</c>.</param>
/// <returns>IEnumerable&lt;DeviceInfo&gt;.</returns>
- Task<QueryResult<DeviceInfo>> GetDevicesForUser(Guid? userId);
+ QueryResult<DeviceInfo> GetDevicesForUser(Guid? userId);
Task DeleteDevice(Device device);
+ Task UpdateDevice(Device device);
+
/// <summary>
/// Determines whether this instance [can access device] the specified user identifier.
/// </summary>
@@ -74,6 +76,6 @@ namespace MediaBrowser.Controller.Devices
Task UpdateDeviceOptions(string deviceId, string deviceName);
- Task<DeviceOptions> GetDeviceOptions(string deviceId);
+ DeviceOptions GetDeviceOptions(string deviceId);
}
}
diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
index 7dfda73bf..6c58064ce 100644
--- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
+++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
@@ -65,11 +65,6 @@ namespace MediaBrowser.Controller.Extensions
public const string SqliteCacheSizeKey = "sqlite:cacheSize";
/// <summary>
- /// Disable second level cache of sqlite.
- /// </summary>
- public const string SqliteDisableSecondLevelCacheKey = "sqlite:disableSecondLevelCache";
-
- /// <summary>
/// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>.
/// </summary>
/// <param name="configuration">The configuration to retrieve the value from.</param>
@@ -133,15 +128,5 @@ namespace MediaBrowser.Controller.Extensions
/// <returns>The sqlite cache size.</returns>
public static int? GetSqliteCacheSize(this IConfiguration configuration)
=> configuration.GetValue<int?>(SqliteCacheSizeKey);
-
- /// <summary>
- /// Gets whether second level cache disabled from the <see cref="IConfiguration" />.
- /// </summary>
- /// <param name="configuration">The configuration to read the setting from.</param>
- /// <returns>Whether second level cache disabled.</returns>
- public static bool GetSqliteSecondLevelCacheDisabled(this IConfiguration configuration)
- {
- return configuration.GetValue<bool>(SqliteDisableSecondLevelCacheKey);
- }
}
}