The Free Software Media System - Server Backend & API
Remove some unused client capabilities and sync code (#10812)
Niels van Velzen55916a09eb4c
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex 44b97e8b83..d0d5bb81c1 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -418,15 +418,6 @@ namespace Emby.Server.Implementations.Dto{dto.PlayAccess = item.GetPlayAccess(user);}-- if (options.ContainsField(ItemFields.BasicSyncInfo))- {- var userCanSync = user is not null && user.HasPermission(PermissionKind.EnableContentDownloading);- if (userCanSync && item.SupportsExternalTransfer)- {- dto.SupportsSync = true;- }- }}private static int GetChildCount(Folder folder, User user)diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.csindex 0544e2a4b7..ca8e204d7c 100644--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs@@ -1095,7 +1095,6 @@ namespace Emby.Server.Implementations.LiveTv// Load these now which will prefetch metadatavar dtoOptions = new DtoOptions();var fields = dtoOptions.Fields.ToList();- fields.Remove(ItemFields.BasicSyncInfo);dtoOptions.Fields = fields.ToArray();progress.Report(100);diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.csindex e8e63d286d..6f599e4c7c 100644--- a/Emby.Server.Implementations/Session/SessionManager.cs+++ b/Emby.Server.Implementations/Session/SessionManager.cs@@ -1670,7 +1670,6 @@ namespace Emby.Server.Implementations.Sessionvar fields = dtoOptions.Fields.ToList();- fields.Remove(ItemFields.BasicSyncInfo);fields.Remove(ItemFields.CanDelete);fields.Remove(ItemFields.CanDownload);fields.Remove(ItemFields.ChildCount);diff --git a/Jellyfin.Api/Controllers/DevicesController.cs b/Jellyfin.Api/Controllers/DevicesController.csindex aa200a7221..6d9ec343e0 100644--- a/Jellyfin.Api/Controllers/DevicesController.cs+++ b/Jellyfin.Api/Controllers/DevicesController.cs@@ -42,16 +42,15 @@ public class DevicesController : BaseJellyfinApiController/// <summary>/// Get Devices./// </summary>- /// <param name="supportsSync">Gets or sets a value indicating whether [supports synchronize].</param>/// <param name="userId">Gets or sets the user identifier.</param>/// <response code="200">Devices retrieved.</response>/// <returns>An <see cref="OkResult"/> containing the list of devices.</returns>[HttpGet][ProducesResponseType(StatusCodes.Status200OK)]- public async Task<ActionResult<QueryResult<DeviceInfo>>> GetDevices([FromQuery] bool? supportsSync, [FromQuery] Guid? userId)+ public async Task<ActionResult<QueryResult<DeviceInfo>>> GetDevices([FromQuery] Guid? userId){userId = RequestHelpers.GetUserId(User, userId);- return await _deviceManager.GetDevicesForUser(userId, supportsSync).ConfigureAwait(false);+ return await _deviceManager.GetDevicesForUser(userId).ConfigureAwait(false);}/// <summary>diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.csindex fdebb3d450..083515a949 100644--- a/Jellyfin.Api/Controllers/SessionController.cs+++ b/Jellyfin.Api/Controllers/SessionController.cs@@ -385,7 +385,6 @@ public class SessionController : BaseJellyfinApiController/// <param name="playableMediaTypes">A list of playable media types, comma delimited. Audio, Video, Book, Photo.</param>/// <param name="supportedCommands">A list of supported remote control commands, comma delimited.</param>/// <param name="supportsMediaControl">Determines whether media can be played remotely..</param>- /// <param name="supportsSync">Determines whether sync is supported.</param>/// <param name="supportsPersistentIdentifier">Determines whether the device supports a unique identifier.</param>/// <response code="204">Capabilities posted.</response>/// <returns>A <see cref="NoContentResult"/>.</returns>@@ -397,7 +396,6 @@ public class SessionController : BaseJellyfinApiController[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] MediaType[] playableMediaTypes,[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] GeneralCommandType[] supportedCommands,[FromQuery] bool supportsMediaControl = false,- [FromQuery] bool supportsSync = false,[FromQuery] bool supportsPersistentIdentifier = true){if (string.IsNullOrWhiteSpace(id))@@ -410,7 +408,6 @@ public class SessionController : BaseJellyfinApiControllerPlayableMediaTypes = playableMediaTypes,SupportedCommands = supportedCommands,SupportsMediaControl = supportsMediaControl,- SupportsSync = supportsSync,SupportsPersistentIdentifier = supportsPersistentIdentifier});return NoContent();diff --git a/Jellyfin.Api/Controllers/UserViewsController.cs b/Jellyfin.Api/Controllers/UserViewsController.csindex 0ffa3ab1ad..035d044741 100644--- a/Jellyfin.Api/Controllers/UserViewsController.cs+++ b/Jellyfin.Api/Controllers/UserViewsController.cs@@ -90,7 +90,6 @@ public class UserViewsController : BaseJellyfinApiControllerfields.Add(ItemFields.PrimaryImageAspectRatio);fields.Add(ItemFields.DisplayPreferencesId);- fields.Remove(ItemFields.BasicSyncInfo);dtoOptions.Fields = fields.ToArray();var user = _userManager.GetUserById(userId);diff --git a/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs b/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.csindex b021771a0f..acd3f29e34 100644--- a/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs+++ b/Jellyfin.Api/Models/SessionDtos/ClientCapabilitiesDto.cs@@ -30,26 +30,11 @@ public class ClientCapabilitiesDto/// </summary>public bool SupportsMediaControl { get; set; }- /// <summary>- /// Gets or sets a value indicating whether session supports content uploading.- /// </summary>- public bool SupportsContentUploading { get; set; }-- /// <summary>- /// Gets or sets the message callback url.- /// </summary>- public string? MessageCallbackUrl { get; set; }-/// <summary>/// Gets or sets a value indicating whether session supports a persistent identifier./// </summary>public bool SupportsPersistentIdentifier { get; set; }- /// <summary>- /// Gets or sets a value indicating whether session supports sync.- /// </summary>- public bool SupportsSync { get; set; }-/// <summary>/// Gets or sets the device profile./// </summary>@@ -76,10 +61,7 @@ public class ClientCapabilitiesDtoPlayableMediaTypes = PlayableMediaTypes,SupportedCommands = SupportedCommands,SupportsMediaControl = SupportsMediaControl,- SupportsContentUploading = SupportsContentUploading,- MessageCallbackUrl = MessageCallbackUrl,SupportsPersistentIdentifier = SupportsPersistentIdentifier,- SupportsSync = SupportsSync,DeviceProfile = DeviceProfile,AppStoreUrl = AppStoreUrl,IconUrl = IconUrldiff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.csindex d8eee12467..5e5d52b6b3 100644--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs@@ -167,7 +167,7 @@ namespace Jellyfin.Server.Implementations.Devices}/// <inheritdoc />- public async Task<QueryResult<DeviceInfo>> GetDevicesForUser(Guid? userId, bool? supportsSync)+ public async Task<QueryResult<DeviceInfo>> GetDevicesForUser(Guid? userId){var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false);await using (dbContext.ConfigureAwait(false))@@ -178,10 +178,6 @@ namespace Jellyfin.Server.Implementations.Devices.ThenBy(d => d.DeviceId).SelectMany(d => dbContext.DeviceOptions.Where(o => o.DeviceId == d.DeviceId).DefaultIfEmpty(), (d, o) => new { Device = d, Options = o }).AsAsyncEnumerable();- if (supportsSync.HasValue)- {- sessions = sessions.Where(i => GetCapabilities(i.Device.DeviceId).SupportsSync == supportsSync.Value);- }if (userId.HasValue){diff --git a/MediaBrowser.Controller/Devices/IDeviceManager.cs b/MediaBrowser.Controller/Devices/IDeviceManager.csindex 8362db1a71..eb181dcc4c 100644--- a/MediaBrowser.Controller/Devices/IDeviceManager.cs+++ b/MediaBrowser.Controller/Devices/IDeviceManager.cs@@ -59,9 +59,8 @@ namespace MediaBrowser.Controller.Devices/// Gets the devices./// </summary>/// <param name="userId">The user's id, or <c>null</c>.</param>- /// <param name="supportsSync">A value indicating whether the device supports sync, or <c>null</c>.</param>/// <returns>IEnumerable<DeviceInfo>.</returns>- Task<QueryResult<DeviceInfo>> GetDevicesForUser(Guid? userId, bool? supportsSync);+ Task<QueryResult<DeviceInfo>> GetDevicesForUser(Guid? userId);Task DeleteDevice(Device device);diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex 7c04fcbfc8..fdbceac961 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -773,8 +773,6 @@ namespace MediaBrowser.Controller.Entities/// <value>The remote trailers.</value>public IReadOnlyList<MediaUrl> RemoteTrailers { get; set; }- public virtual bool SupportsExternalTransfer => false;-public virtual double GetDefaultPrimaryImageAspectRatio(){return 0;diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.csindex d257eab920..cfff717db2 100644--- a/MediaBrowser.Model/Dto/BaseItemDto.cs+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs@@ -85,11 +85,6 @@ namespace MediaBrowser.Model.Dtopublic string PreferredMetadataCountryCode { get; set; }- /// <summary>- /// Gets or sets a value indicating whether [supports synchronize].- /// </summary>- public bool? SupportsSync { get; set; }-public string Container { get; set; }/// <summary>diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.csindex 242a1c6e99..49d7c0bcb0 100644--- a/MediaBrowser.Model/Querying/ItemFields.cs+++ b/MediaBrowser.Model/Querying/ItemFields.cs@@ -175,13 +175,6 @@ namespace MediaBrowser.Model.Querying/// </summary>Studios,- BasicSyncInfo,-- /// <summary>- /// The synchronize information.- /// </summary>- SyncInfo,-/// <summary>/// The taglines of the item./// </summary>diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.csindex 7fefce9cd5..597845fc17 100644--- a/MediaBrowser.Model/Session/ClientCapabilities.cs+++ b/MediaBrowser.Model/Session/ClientCapabilities.cs@@ -23,14 +23,8 @@ namespace MediaBrowser.Model.Sessionpublic bool SupportsMediaControl { get; set; }- public bool SupportsContentUploading { get; set; }-- public string MessageCallbackUrl { get; set; }-public bool SupportsPersistentIdentifier { get; set; }- public bool SupportsSync { get; set; }-public DeviceProfile DeviceProfile { get; set; }public string AppStoreUrl { get; set; }