mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Migrate to file-scoped namespaces
This commit is contained in:
parent
58b3945805
commit
f5f890e685
@ -2,14 +2,14 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Internal produces image attribute.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class AcceptsFileAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal produces image attribute.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class AcceptsFileAttribute : Attribute
|
||||
{
|
||||
private readonly string[] _contentTypes;
|
||||
|
||||
/// <summary>
|
||||
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
|
||||
/// </summary>
|
||||
/// <returns>the configured content types.</returns>
|
||||
public string[] ContentTypes => _contentTypes;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class AcceptsImageFileAttribute : AcceptsFileAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class AcceptsImageFileAttribute : AcceptsFileAttribute
|
||||
{
|
||||
private const string ContentType = "image/*";
|
||||
|
||||
/// <summary>
|
||||
@ -14,5 +14,4 @@
|
||||
: base(ContentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Routing;
|
||||
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Identifies an action that supports the HTTP GET method.
|
||||
/// </summary>
|
||||
public sealed class HttpSubscribeAttribute : HttpMethodAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies an action that supports the HTTP GET method.
|
||||
/// </summary>
|
||||
public sealed class HttpSubscribeAttribute : HttpMethodAttribute
|
||||
{
|
||||
private static readonly IEnumerable<string> _supportedMethods = new[] { "SUBSCRIBE" };
|
||||
|
||||
/// <summary>
|
||||
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
|
||||
public HttpSubscribeAttribute(string template)
|
||||
: base(_supportedMethods, template)
|
||||
=> ArgumentNullException.ThrowIfNull(template);
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Routing;
|
||||
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Identifies an action that supports the HTTP GET method.
|
||||
/// </summary>
|
||||
public sealed class HttpUnsubscribeAttribute : HttpMethodAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies an action that supports the HTTP GET method.
|
||||
/// </summary>
|
||||
public sealed class HttpUnsubscribeAttribute : HttpMethodAttribute
|
||||
{
|
||||
private static readonly IEnumerable<string> _supportedMethods = new[] { "UNSUBSCRIBE" };
|
||||
|
||||
/// <summary>
|
||||
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
|
||||
public HttpUnsubscribeAttribute(string template)
|
||||
: base(_supportedMethods, template)
|
||||
=> ArgumentNullException.ThrowIfNull(template);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Attribute to mark a parameter as obsolete.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class ParameterObsoleteAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute to mark a parameter as obsolete.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class ParameterObsoleteAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesAudioFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesAudioFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
private const string ContentType = "audio/*";
|
||||
|
||||
/// <summary>
|
||||
@ -14,5 +14,4 @@
|
||||
: base(ContentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Internal produces image attribute.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class ProducesFileAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal produces image attribute.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class ProducesFileAttribute : Attribute
|
||||
{
|
||||
private readonly string[] _contentTypes;
|
||||
|
||||
/// <summary>
|
||||
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
|
||||
/// </summary>
|
||||
/// <returns>the configured content types.</returns>
|
||||
public string[] ContentTypes => _contentTypes;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesImageFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesImageFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
private const string ContentType = "image/*";
|
||||
|
||||
/// <summary>
|
||||
@ -14,5 +14,4 @@
|
||||
: base(ContentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesPlaylistFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Produces file attribute of "image/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesPlaylistFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
private const string ContentType = "application/x-mpegURL";
|
||||
|
||||
/// <summary>
|
||||
@ -14,5 +14,4 @@
|
||||
: base(ContentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Attributes
|
||||
namespace Jellyfin.Api.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Produces file attribute of "video/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesVideoFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Produces file attribute of "video/*".
|
||||
/// </summary>
|
||||
public sealed class ProducesVideoFileAttribute : ProducesFileAttribute
|
||||
{
|
||||
private const string ContentType = "video/*";
|
||||
|
||||
/// <summary>
|
||||
@ -14,5 +14,4 @@
|
||||
: base(ContentType)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,19 +4,19 @@ using Jellyfin.Api.Results;
|
||||
using Jellyfin.Extensions.Json;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Base api controller for the API setting a default route.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
[Produces(
|
||||
namespace Jellyfin.Api;
|
||||
|
||||
/// <summary>
|
||||
/// Base api controller for the API setting a default route.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
[Produces(
|
||||
MediaTypeNames.Application.Json,
|
||||
JsonDefaults.CamelCaseMediaType,
|
||||
JsonDefaults.PascalCaseMediaType)]
|
||||
public class BaseJellyfinApiController : ControllerBase
|
||||
{
|
||||
public class BaseJellyfinApiController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new <see cref="OkResult{T}"/>.
|
||||
/// </summary>
|
||||
@ -34,5 +34,4 @@ namespace Jellyfin.Api
|
||||
/// <returns>The <see cref="ActionResult{T}"/>.</returns>
|
||||
protected ActionResult<T> Ok<T>(T value)
|
||||
=> new OkResult<T>(value);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
namespace Jellyfin.Api.Constants
|
||||
namespace Jellyfin.Api.Constants;
|
||||
|
||||
/// <summary>
|
||||
/// Authentication schemes for user authentication in the API.
|
||||
/// </summary>
|
||||
public static class AuthenticationSchemes
|
||||
{
|
||||
/// <summary>
|
||||
/// Authentication schemes for user authentication in the API.
|
||||
/// </summary>
|
||||
public static class AuthenticationSchemes
|
||||
{
|
||||
/// <summary>
|
||||
/// Scheme name for the custom legacy authentication.
|
||||
/// </summary>
|
||||
public const string CustomAuthentication = "CustomAuthentication";
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Constants
|
||||
namespace Jellyfin.Api.Constants;
|
||||
|
||||
/// <summary>
|
||||
/// Internal claim types for authorization.
|
||||
/// </summary>
|
||||
public static class InternalClaimTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal claim types for authorization.
|
||||
/// </summary>
|
||||
public static class InternalClaimTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// User Id.
|
||||
/// </summary>
|
||||
@ -39,5 +39,4 @@
|
||||
/// Is Api Key.
|
||||
/// </summary>
|
||||
public const string IsApiKey = "Jellyfin-IsApiKey";
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Constants
|
||||
namespace Jellyfin.Api.Constants;
|
||||
|
||||
/// <summary>
|
||||
/// Policies for the API authorization.
|
||||
/// </summary>
|
||||
public static class Policies
|
||||
{
|
||||
/// <summary>
|
||||
/// Policies for the API authorization.
|
||||
/// </summary>
|
||||
public static class Policies
|
||||
{
|
||||
/// <summary>
|
||||
/// Policy name for default authorization.
|
||||
/// </summary>
|
||||
@ -74,5 +74,4 @@ namespace Jellyfin.Api.Constants
|
||||
/// Policy name for accessing a SyncPlay group.
|
||||
/// </summary>
|
||||
public const string SyncPlayIsInGroup = "SyncPlayIsInGroup";
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
namespace Jellyfin.Api.Constants
|
||||
namespace Jellyfin.Api.Constants;
|
||||
|
||||
/// <summary>
|
||||
/// Constants for user roles used in the authentication and authorization for the API.
|
||||
/// </summary>
|
||||
public static class UserRoles
|
||||
{
|
||||
/// <summary>
|
||||
/// Constants for user roles used in the authentication and authorization for the API.
|
||||
/// </summary>
|
||||
public static class UserRoles
|
||||
{
|
||||
/// <summary>
|
||||
/// Guest user.
|
||||
/// </summary>
|
||||
@ -19,5 +19,4 @@ namespace Jellyfin.Api.Constants
|
||||
/// Administrator user with elevated privileges.
|
||||
/// </summary>
|
||||
public const string Administrator = "Administrator";
|
||||
}
|
||||
}
|
||||
|
@ -8,15 +8,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log controller.
|
||||
/// </summary>
|
||||
[Route("System/ActivityLog")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ActivityLogController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity log controller.
|
||||
/// </summary>
|
||||
[Route("System/ActivityLog")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ActivityLogController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IActivityManager _activityManager;
|
||||
|
||||
/// <summary>
|
||||
@ -53,5 +53,4 @@ namespace Jellyfin.Api.Controllers
|
||||
HasUserId = hasUserId
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Authentication controller.
|
||||
/// </summary>
|
||||
[Route("Auth")]
|
||||
public class ApiKeyController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Authentication controller.
|
||||
/// </summary>
|
||||
[Route("Auth")]
|
||||
public class ApiKeyController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IAuthenticationManager _authenticationManager;
|
||||
|
||||
/// <summary>
|
||||
@ -72,5 +72,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The artists controller.
|
||||
/// </summary>
|
||||
[Route("Artists")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ArtistsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The artists controller.
|
||||
/// </summary>
|
||||
[Route("Artists")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ArtistsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -476,5 +476,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,14 @@ using MediaBrowser.Model.Dlna;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The audio controller.
|
||||
/// </summary>
|
||||
// TODO: In order to authenticate this in the future, Dlna playback will require updating
|
||||
public class AudioController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The audio controller.
|
||||
/// </summary>
|
||||
// TODO: In order to authenticate this in the future, Dlna playback will require updating
|
||||
public class AudioController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly AudioHelper _audioHelper;
|
||||
|
||||
private readonly TranscodingJobType _transcodingJobType = TranscodingJobType.Progressive;
|
||||
@ -360,5 +360,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return await _audioHelper.GetAudioStream(_transcodingJobType, streamingRequest).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ using MediaBrowser.Model.Branding;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Branding controller.
|
||||
/// </summary>
|
||||
public class BrandingController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Branding controller.
|
||||
/// </summary>
|
||||
public class BrandingController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
|
||||
/// <summary>
|
||||
@ -53,5 +53,4 @@ namespace Jellyfin.Api.Controllers
|
||||
var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");
|
||||
return options.CustomCss ?? string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Channels Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ChannelsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Channels Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ChannelsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IChannelManager _channelManager;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
@ -247,5 +247,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return await _channelManager.GetLatestChannelItems(query, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,14 +11,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Client log controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ClientLogController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Client log controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ClientLogController : BaseJellyfinApiController
|
||||
{
|
||||
private const int MaxDocumentSize = 1_000_000;
|
||||
private readonly IClientEventLogger _clientEventLogger;
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
@ -77,5 +77,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return (clientName, clientVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,15 +11,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The collection controller.
|
||||
/// </summary>
|
||||
[Route("Collections")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class CollectionController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The collection controller.
|
||||
/// </summary>
|
||||
[Route("Collections")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class CollectionController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ICollectionManager _collectionManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
|
||||
@ -107,5 +107,4 @@ namespace Jellyfin.Api.Controllers
|
||||
await _collectionManager.RemoveFromCollectionAsync(collectionId, ids).ConfigureAwait(false);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,15 +13,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration Controller.
|
||||
/// </summary>
|
||||
[Route("System")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ConfigurationController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration Controller.
|
||||
/// </summary>
|
||||
[Route("System")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ConfigurationController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerConfigurationManager _configurationManager;
|
||||
private readonly IMediaEncoder _mediaEncoder;
|
||||
|
||||
@ -132,5 +132,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_mediaEncoder.UpdateEncoderPath(mediaEncoderPath.Path, mediaEncoderPath.PathType);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The dashboard controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class DashboardController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The dashboard controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class DashboardController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILogger<DashboardController> _logger;
|
||||
private readonly IPluginManager _pluginManager;
|
||||
|
||||
@ -112,5 +112,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return _pluginManager.Plugins.SelectMany(GetPluginPages);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Devices Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class DevicesController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Devices Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class DevicesController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IDeviceManager _deviceManager;
|
||||
private readonly ISessionManager _sessionManager;
|
||||
|
||||
@ -137,5 +137,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Display Preferences Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class DisplayPreferencesController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Display Preferences Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class DisplayPreferencesController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IDisplayPreferencesManager _displayPreferencesManager;
|
||||
private readonly ILogger<DisplayPreferencesController> _logger;
|
||||
|
||||
@ -210,5 +210,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Dlna Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class DlnaController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Dlna Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class DlnaController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IDlnaManager _dlnaManager;
|
||||
|
||||
/// <summary>
|
||||
@ -129,5 +129,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_dlnaManager.UpdateProfile(profileId, deviceProfile);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,16 +14,16 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Dlna Server Controller.
|
||||
/// </summary>
|
||||
[Route("Dlna")]
|
||||
[DlnaEnabled]
|
||||
[Authorize(Policy = Policies.AnonymousLanAccessPolicy)]
|
||||
public class DlnaServerController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Dlna Server Controller.
|
||||
/// </summary>
|
||||
[Route("Dlna")]
|
||||
[DlnaEnabled]
|
||||
[Authorize(Policy = Policies.AnonymousLanAccessPolicy)]
|
||||
public class DlnaServerController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IDlnaManager _dlnaManager;
|
||||
private readonly IContentDirectory _contentDirectory;
|
||||
private readonly IConnectionManager _connectionManager;
|
||||
@ -320,5 +320,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return dlnaEventManager.CancelEventSubscription(subscriptionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,15 +30,15 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic hls controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class DynamicHlsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Dynamic hls controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class DynamicHlsController : BaseJellyfinApiController
|
||||
{
|
||||
private const string DefaultVodEncoderPreset = "veryfast";
|
||||
private const string DefaultEventEncoderPreset = "superfast";
|
||||
private const TranscodingJobType TranscodingJobType = MediaBrowser.Controller.MediaEncoding.TranscodingJobType.Hls;
|
||||
@ -2051,5 +2051,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_logger.LogError(ex, "Error deleting partial stream file(s) {Path}", path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,14 +12,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Environment Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class EnvironmentController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Environment Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class EnvironmentController : BaseJellyfinApiController
|
||||
{
|
||||
private const char UncSeparator = '\\';
|
||||
private const string UncStartPrefix = @"\\";
|
||||
|
||||
@ -193,5 +193,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return new DefaultDirectoryBrowserInfoDto();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,15 +12,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Filters controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class FilterController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Filters controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class FilterController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
@ -212,5 +212,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return filters;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Genre = MediaBrowser.Controller.Entities.Genre;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The genres controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class GenresController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The genres controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class GenresController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -207,5 +207,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The hls segment controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class HlsSegmentController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The hls segment controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class HlsSegmentController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly TranscodingJobHelper _transcodingJobHelper;
|
||||
@ -188,5 +188,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return FileStreamResponseHelpers.GetStaticFileResult(path, MimeTypes.GetMimeType(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,14 +30,14 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Image controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class ImageController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Image controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class ImageController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IProviderManager _providerManager;
|
||||
@ -2096,5 +2096,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return PhysicalFile(imagePath, imageContentType ?? MediaTypeNames.Text.Plain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,15 +16,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The instant mix controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class InstantMixController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The instant mix controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class InstantMixController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -357,5 +357,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,15 +18,15 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Item lookup controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ItemLookupController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Item lookup controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ItemLookupController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -270,5 +270,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,15 +9,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Item Refresh Controller.
|
||||
/// </summary>
|
||||
[Route("Items")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ItemRefreshController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Item Refresh Controller.
|
||||
/// </summary>
|
||||
[Route("Items")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ItemRefreshController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
@ -82,5 +82,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_providerManager.QueueRefresh(item.Id, refreshOptions, RefreshPriority.High);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Item update controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ItemUpdateController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Item update controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ItemUpdateController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly ILocalizationManager _localizationManager;
|
||||
@ -445,5 +445,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The items controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ItemsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The items controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class ItemsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly ILocalizationManager _localization;
|
||||
@ -869,5 +869,4 @@ namespace Jellyfin.Api.Controllers
|
||||
itemsResult.TotalRecordCount,
|
||||
returnItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,14 +37,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Library Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class LibraryController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Library Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class LibraryController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
@ -968,5 +968,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return metadataOptions.Any(i => !i.DisabledImageFetchers.Contains(name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The library structure controller.
|
||||
/// </summary>
|
||||
[Route("Library/VirtualFolders")]
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class LibraryStructureController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The library structure controller.
|
||||
/// </summary>
|
||||
[Route("Library/VirtualFolders")]
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class LibraryStructureController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerApplicationPaths _appPaths;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly ILibraryMonitor _libraryMonitor;
|
||||
@ -323,5 +323,4 @@ namespace Jellyfin.Api.Controllers
|
||||
collectionFolder.UpdateLibraryOptions(request.LibraryOptions);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,13 +35,13 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Live tv controller.
|
||||
/// </summary>
|
||||
public class LiveTvController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Live tv controller.
|
||||
/// </summary>
|
||||
public class LiveTvController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILiveTvManager _liveTvManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
@ -1230,5 +1230,4 @@ namespace Jellyfin.Api.Controllers
|
||||
throw new SecurityException("The current user does not have permission to manage live tv.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,14 +6,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Localization controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrDefault)]
|
||||
public class LocalizationController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Localization controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrDefault)]
|
||||
public class LocalizationController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILocalizationManager _localization;
|
||||
|
||||
/// <summary>
|
||||
@ -72,5 +72,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return Ok(_localization.GetLocalizationOptions());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,15 +19,15 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The media info controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MediaInfoController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The media info controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MediaInfoController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IMediaSourceManager _mediaSourceManager;
|
||||
private readonly IDeviceManager _deviceManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -309,5 +309,4 @@ namespace Jellyfin.Api.Controllers
|
||||
ArrayPool<byte>.Shared.Return(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ using MediaBrowser.Model.Querying;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Movies controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MoviesController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Movies controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MoviesController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -322,5 +322,4 @@ namespace Jellyfin.Api.Controllers
|
||||
.Select(i => i.Name)
|
||||
.DistinctNames();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The music genres controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MusicGenresController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The music genres controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class MusicGenresController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly IUserManager _userManager;
|
||||
@ -194,5 +194,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,15 +11,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Package Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PackageController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Package Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PackageController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IInstallationManager _installationManager;
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
|
||||
@ -163,5 +163,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_serverConfigurationManager.SaveConfiguration();
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Persons controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PersonsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Persons controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PersonsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly IUserManager _userManager;
|
||||
@ -135,5 +135,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,14 +20,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Playlists controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PlaylistsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Playlists controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PlaylistsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IPlaylistManager _playlistManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly IUserManager _userManager;
|
||||
@ -217,5 +217,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Playstate controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PlaystateController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Playstate controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PlaystateController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -378,5 +378,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return method;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,14 +17,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Plugins controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PluginsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Plugins controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class PluginsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IInstallationManager _installationManager;
|
||||
private readonly IPluginManager _pluginManager;
|
||||
private readonly JsonSerializerOptions _serializerOptions;
|
||||
@ -262,5 +262,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,13 +13,13 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Quick connect controller.
|
||||
/// </summary>
|
||||
public class QuickConnectController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Quick connect controller.
|
||||
/// </summary>
|
||||
public class QuickConnectController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IQuickConnect _quickConnect;
|
||||
private readonly IAuthorizationContext _authContext;
|
||||
|
||||
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Controllers
|
||||
return Unauthorized("Quick connect is disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Remote Images Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class RemoteImageController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Remote Images Controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class RemoteImageController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly IServerApplicationPaths _applicationPaths;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -175,5 +175,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return Path.Combine(_applicationPaths.CachePath, "remote-images", filename.Substring(0, 1), filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,14 +8,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled Tasks Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ScheduledTasksController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Scheduled Tasks Controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.RequiresElevation)]
|
||||
public class ScheduledTasksController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ITaskManager _taskManager;
|
||||
|
||||
/// <summary>
|
||||
@ -157,5 +157,4 @@ namespace Jellyfin.Api.Controllers
|
||||
task.Triggers = triggerInfos;
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Search controller.
|
||||
/// </summary>
|
||||
[Route("Search/Hints")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class SearchController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Search controller.
|
||||
/// </summary>
|
||||
[Route("Search/Hints")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class SearchController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ISearchEngine _searchEngine;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -262,5 +262,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return item.GetParents().OfType<T>().FirstOrDefault(i => i.HasImage(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The session controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class SessionController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The session controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class SessionController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDeviceManager _deviceManager;
|
||||
@ -494,5 +494,4 @@ namespace Jellyfin.Api.Controllers
|
||||
{
|
||||
return _userManager.GetPasswordResetProviders();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The startup wizard controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class StartupController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The startup wizard controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.FirstTimeSetupOrElevated)]
|
||||
public class StartupController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
@ -146,5 +146,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Studios controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class StudiosController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Studios controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class StudiosController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -152,5 +152,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return _dtoService.GetBaseItemDto(item, dtoOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,14 +30,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Subtitle controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class SubtitleController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Subtitle controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class SubtitleController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly ISubtitleManager _subtitleManager;
|
||||
@ -547,5 +547,4 @@ namespace Jellyfin.Api.Controllers
|
||||
// returning HTTP 204 will break the SubtitlesOctopus
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,15 +13,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The suggestions controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class SuggestionsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The suggestions controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class SuggestionsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -88,5 +88,4 @@ namespace Jellyfin.Api.Controllers
|
||||
result.TotalRecordCount,
|
||||
dtoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The sync play controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.SyncPlayHasAccess)]
|
||||
public class SyncPlayController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The sync play controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.SyncPlayHasAccess)]
|
||||
public class SyncPlayController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly ISyncPlayManager _syncPlayManager;
|
||||
private readonly IUserManager _userManager;
|
||||
@ -420,5 +420,4 @@ namespace Jellyfin.Api.Controllers
|
||||
_syncPlayManager.HandleRequest(currentSession, syncPlayRequest, CancellationToken.None);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,13 +20,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The system controller.
|
||||
/// </summary>
|
||||
public class SystemController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The system controller.
|
||||
/// </summary>
|
||||
public class SystemController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
@ -219,5 +219,4 @@ namespace Jellyfin.Api.Controllers
|
||||
.Select(i => new WakeOnLanInfo(i));
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,14 +3,14 @@ using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The time sync controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class TimeSyncController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The time sync controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class TimeSyncController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current UTC time.
|
||||
/// </summary>
|
||||
@ -30,5 +30,4 @@ namespace Jellyfin.Api.Controllers
|
||||
// information being sent. On the other hand it enables future additions.
|
||||
return new UtcTimeResponse(requestReceptionTime, responseTransmissionTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The trailers controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class TrailersController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The trailers controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class TrailersController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ItemsController _itemsController;
|
||||
|
||||
/// <summary>
|
||||
@ -295,5 +295,4 @@ namespace Jellyfin.Api.Controllers
|
||||
enableTotalRecordCount,
|
||||
enableImages);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,15 +19,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The tv shows controller.
|
||||
/// </summary>
|
||||
[Route("Shows")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class TvShowsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The tv shows controller.
|
||||
/// </summary>
|
||||
[Route("Shows")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class TvShowsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -380,5 +380,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,14 +20,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The universal audio controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class UniversalAudioController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The universal audio controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
public class UniversalAudioController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly ILogger<UniversalAudioController> _logger;
|
||||
private readonly MediaInfoHelper _mediaInfoHelper;
|
||||
@ -336,5 +336,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return deviceProfile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,14 +25,14 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// User controller.
|
||||
/// </summary>
|
||||
[Route("Users")]
|
||||
public class UserController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// User controller.
|
||||
/// </summary>
|
||||
[Route("Users")]
|
||||
public class UserController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly INetworkManager _networkManager;
|
||||
@ -584,5 +584,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,15 +23,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// User library controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class UserLibraryController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// User library controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class UserLibraryController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -424,5 +424,4 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// User views controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class UserViewsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// User views controller.
|
||||
/// </summary>
|
||||
[Route("")]
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class UserViewsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserViewManager _userViewManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Controllers
|
||||
.OrderBy(i => i.Name)
|
||||
.AsEnumerable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,14 @@ using MediaBrowser.Controller.MediaEncoding;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Attachments controller.
|
||||
/// </summary>
|
||||
[Route("Videos")]
|
||||
public class VideoAttachmentsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Attachments controller.
|
||||
/// </summary>
|
||||
[Route("Videos")]
|
||||
public class VideoAttachmentsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IAttachmentExtractor _attachmentExtractor;
|
||||
|
||||
@ -78,5 +78,4 @@ namespace Jellyfin.Api.Controllers
|
||||
return NotFound(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,13 +32,13 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// The videos controller.
|
||||
/// </summary>
|
||||
public class VideosController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// The videos controller.
|
||||
/// </summary>
|
||||
public class VideosController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -671,5 +671,4 @@ namespace Jellyfin.Api.Controllers
|
||||
context,
|
||||
streamOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Controllers
|
||||
namespace Jellyfin.Api.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Years controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class YearsController : BaseJellyfinApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// Years controller.
|
||||
/// </summary>
|
||||
[Authorize(Policy = Policies.DefaultAuthorization)]
|
||||
public class YearsController : BaseJellyfinApiController
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
@ -222,5 +222,4 @@ namespace Jellyfin.Api.Controllers
|
||||
.Distinct()
|
||||
.Select(year => _libraryManager.GetYear(year));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Extensions
|
||||
namespace Jellyfin.Api.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// Dto Extensions.
|
||||
/// </summary>
|
||||
public static class DtoExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Dto Extensions.
|
||||
/// </summary>
|
||||
public static class DtoExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Add additional fields depending on client.
|
||||
/// </summary>
|
||||
@ -112,5 +112,4 @@ namespace Jellyfin.Api.Extensions
|
||||
|
||||
return dtoOptions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ using Jellyfin.Extensions.Json;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Formatters
|
||||
namespace Jellyfin.Api.Formatters;
|
||||
|
||||
/// <summary>
|
||||
/// Camel Case Json Profile Formatter.
|
||||
/// </summary>
|
||||
public class CamelCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Camel Case Json Profile Formatter.
|
||||
/// </summary>
|
||||
public class CamelCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class.
|
||||
/// </summary>
|
||||
@ -17,5 +17,4 @@ namespace Jellyfin.Api.Formatters
|
||||
SupportedMediaTypes.Clear();
|
||||
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.CamelCaseMediaType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
||||
namespace Jellyfin.Api.Formatters
|
||||
namespace Jellyfin.Api.Formatters;
|
||||
|
||||
/// <summary>
|
||||
/// Css output formatter.
|
||||
/// </summary>
|
||||
public class CssOutputFormatter : TextOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Css output formatter.
|
||||
/// </summary>
|
||||
public class CssOutputFormatter : TextOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CssOutputFormatter"/> class.
|
||||
/// </summary>
|
||||
@ -32,5 +32,4 @@ namespace Jellyfin.Api.Formatters
|
||||
var stringResponse = context.Object?.ToString();
|
||||
return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ using Jellyfin.Extensions.Json;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Formatters
|
||||
namespace Jellyfin.Api.Formatters;
|
||||
|
||||
/// <summary>
|
||||
/// Pascal Case Json Profile Formatter.
|
||||
/// </summary>
|
||||
public class PascalCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Pascal Case Json Profile Formatter.
|
||||
/// </summary>
|
||||
public class PascalCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class.
|
||||
/// </summary>
|
||||
@ -20,5 +20,4 @@ namespace Jellyfin.Api.Formatters
|
||||
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json));
|
||||
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.PascalCaseMediaType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
||||
namespace Jellyfin.Api.Formatters
|
||||
namespace Jellyfin.Api.Formatters;
|
||||
|
||||
/// <summary>
|
||||
/// Xml output formatter.
|
||||
/// </summary>
|
||||
public class XmlOutputFormatter : TextOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Xml output formatter.
|
||||
/// </summary>
|
||||
public class XmlOutputFormatter : TextOutputFormatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class.
|
||||
/// </summary>
|
||||
@ -29,5 +29,4 @@ namespace Jellyfin.Api.Formatters
|
||||
var stringResponse = context.Object?.ToString();
|
||||
return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,13 +16,13 @@ using MediaBrowser.Model.Net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Audio helper.
|
||||
/// </summary>
|
||||
public class AudioHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Audio helper.
|
||||
/// </summary>
|
||||
public class AudioHelper
|
||||
{
|
||||
private readonly IDlnaManager _dlnaManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@ -176,5 +176,4 @@ namespace Jellyfin.Api.Helpers
|
||||
transcodingJobType,
|
||||
cancellationTokenSource).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,13 +25,13 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic hls helper.
|
||||
/// </summary>
|
||||
public class DynamicHlsHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Dynamic hls helper.
|
||||
/// </summary>
|
||||
public class DynamicHlsHelper
|
||||
{
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IDlnaManager _dlnaManager;
|
||||
@ -745,5 +745,4 @@ namespace Jellyfin.Api.Helpers
|
||||
|
||||
return newPlaylist.Contains(",fLaC\"", StringComparison.Ordinal) ? newPlaylist : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,13 +11,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// The stream response helpers.
|
||||
/// </summary>
|
||||
public static class FileStreamResponseHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// The stream response helpers.
|
||||
/// </summary>
|
||||
public static class FileStreamResponseHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a static file from a remote source.
|
||||
/// </summary>
|
||||
@ -116,5 +116,4 @@ namespace Jellyfin.Api.Helpers
|
||||
transcodingLock.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Hls Codec string helpers.
|
||||
/// </summary>
|
||||
public static class HlsCodecStringHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Hls Codec string helpers.
|
||||
/// </summary>
|
||||
public static class HlsCodecStringHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Codec name for MP3.
|
||||
/// </summary>
|
||||
@ -179,5 +179,4 @@ namespace Jellyfin.Api.Helpers
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,13 +8,13 @@ using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Model.IO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// The hls helpers.
|
||||
/// </summary>
|
||||
public static class HlsHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// The hls helpers.
|
||||
/// </summary>
|
||||
public static class HlsHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Waits for a minimum number of segments to be available.
|
||||
/// </summary>
|
||||
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Helpers
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,13 +25,13 @@ using MediaBrowser.Model.Session;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Media info helper.
|
||||
/// </summary>
|
||||
public class MediaInfoHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Media info helper.
|
||||
/// </summary>
|
||||
public class MediaInfoHelper
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IMediaSourceManager _mediaSourceManager;
|
||||
@ -496,5 +496,4 @@ namespace Jellyfin.Api.Helpers
|
||||
|
||||
return maxBitrate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ using System.Threading.Tasks;
|
||||
using Jellyfin.Api.Models.PlaybackDtos;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// A progressive file stream for transferring transcoded files as they are written to.
|
||||
/// </summary>
|
||||
public class ProgressiveFileStream : Stream
|
||||
{
|
||||
/// <summary>
|
||||
/// A progressive file stream for transferring transcoded files as they are written to.
|
||||
/// </summary>
|
||||
public class ProgressiveFileStream : Stream
|
||||
{
|
||||
private readonly Stream _stream;
|
||||
private readonly TranscodingJobDto? _job;
|
||||
private readonly TranscodingJobHelper? _transcodingJobHelper;
|
||||
@ -179,5 +179,4 @@ namespace Jellyfin.Api.Helpers
|
||||
// but don't keep it open indefinitely if it isn't reading anything
|
||||
return bytesRead > 0 || (_job?.HasExited ?? elapsed >= _timeoutMs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,13 +16,13 @@ using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Request Extensions.
|
||||
/// </summary>
|
||||
public static class RequestHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Request Extensions.
|
||||
/// </summary>
|
||||
public static class RequestHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Get Order By.
|
||||
/// </summary>
|
||||
@ -144,5 +144,4 @@ namespace Jellyfin.Api.Helpers
|
||||
result.TotalRecordCount,
|
||||
dtos.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,13 +22,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// The streaming helpers.
|
||||
/// </summary>
|
||||
public static class StreamingHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// The streaming helpers.
|
||||
/// </summary>
|
||||
public static class StreamingHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current streaming state.
|
||||
/// </summary>
|
||||
@ -779,5 +779,4 @@ namespace Jellyfin.Api.Helpers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,13 +27,13 @@ using MediaBrowser.Model.Session;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Helpers
|
||||
namespace Jellyfin.Api.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Transcoding job helpers.
|
||||
/// </summary>
|
||||
public class TranscodingJobHelper : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Transcoding job helpers.
|
||||
/// </summary>
|
||||
public class TranscodingJobHelper : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The active transcoding jobs.
|
||||
/// </summary>
|
||||
@ -291,7 +291,7 @@ namespace Jellyfin.Api.Helpers
|
||||
|
||||
lock (job.ProcessLock!)
|
||||
{
|
||||
#pragma warning disable CA1849 // Can't await in lock block
|
||||
#pragma warning disable CA1849 // Can't await in lock block
|
||||
job.TranscodingThrottler?.Stop().GetAwaiter().GetResult();
|
||||
|
||||
var process = job.Process;
|
||||
@ -317,7 +317,7 @@ namespace Jellyfin.Api.Helpers
|
||||
{
|
||||
}
|
||||
}
|
||||
#pragma warning restore CA1849
|
||||
#pragma warning restore CA1849
|
||||
}
|
||||
|
||||
if (delete(job.Path!))
|
||||
@ -910,5 +910,4 @@ namespace Jellyfin.Api.Helpers
|
||||
_sessionManager.PlaybackStart -= OnPlaybackProgress;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Redirect requests without baseurl prefix to the baseurl prefixed URL.
|
||||
/// </summary>
|
||||
public class BaseUrlRedirectionMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Redirect requests without baseurl prefix to the baseurl prefixed URL.
|
||||
/// </summary>
|
||||
public class BaseUrlRedirectionMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly ILogger<BaseUrlRedirectionMiddleware> _logger;
|
||||
private readonly IConfiguration _configuration;
|
||||
@ -77,5 +77,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Exception Middleware.
|
||||
/// </summary>
|
||||
public class ExceptionMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception Middleware.
|
||||
/// </summary>
|
||||
public class ExceptionMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly ILogger<ExceptionMiddleware> _logger;
|
||||
private readonly IServerConfigurationManager _configuration;
|
||||
@ -147,5 +147,4 @@ namespace Jellyfin.Api.Middleware
|
||||
string.Empty,
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Validates the IP of requests coming from local networks wrt. remote access.
|
||||
/// </summary>
|
||||
public class IpBasedAccessValidationMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the IP of requests coming from local networks wrt. remote access.
|
||||
/// </summary>
|
||||
public class IpBasedAccessValidationMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
/// <summary>
|
||||
@ -46,5 +46,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,13 +5,13 @@ using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Validates the LAN host IP based on application configuration.
|
||||
/// </summary>
|
||||
public class LanFilteringMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the LAN host IP based on application configuration.
|
||||
/// </summary>
|
||||
public class LanFilteringMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
/// <summary>
|
||||
@ -41,5 +41,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Removes /emby and /mediabrowser from requested route.
|
||||
/// </summary>
|
||||
public class LegacyEmbyRouteRewriteMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Removes /emby and /mediabrowser from requested route.
|
||||
/// </summary>
|
||||
public class LegacyEmbyRouteRewriteMiddleware
|
||||
{
|
||||
private const string EmbyPath = "/emby";
|
||||
private const string MediabrowserPath = "/mediabrowser";
|
||||
|
||||
@ -50,5 +50,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// URL decodes the querystring before binding.
|
||||
/// </summary>
|
||||
public class QueryStringDecodingMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// URL decodes the querystring before binding.
|
||||
/// </summary>
|
||||
public class QueryStringDecodingMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
/// <summary>
|
||||
@ -35,5 +35,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Response time middleware.
|
||||
/// </summary>
|
||||
public class ResponseTimeMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Response time middleware.
|
||||
/// </summary>
|
||||
public class ResponseTimeMiddleware
|
||||
{
|
||||
private const string ResponseHeaderResponseTime = "X-Response-Time-ms";
|
||||
|
||||
private readonly RequestDelegate _next;
|
||||
@ -65,5 +65,4 @@ namespace Jellyfin.Api.Middleware
|
||||
// Call the next delegate/middleware in the pipeline
|
||||
await this._next(context).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Redirect requests to robots.txt to web/robots.txt.
|
||||
/// </summary>
|
||||
public class RobotsRedirectionMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Redirect requests to robots.txt to web/robots.txt.
|
||||
/// </summary>
|
||||
public class RobotsRedirectionMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
private readonly ILogger<RobotsRedirectionMiddleware> _logger;
|
||||
|
||||
@ -43,5 +43,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await _next(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,13 +5,13 @@ using MediaBrowser.Controller;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Shows a custom message during server startup.
|
||||
/// </summary>
|
||||
public class ServerStartupMessageMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows a custom message during server startup.
|
||||
/// </summary>
|
||||
public class ServerStartupMessageMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
/// <summary>
|
||||
@ -47,5 +47,4 @@ namespace Jellyfin.Api.Middleware
|
||||
httpContext.Response.ContentType = MediaTypeNames.Text.Html;
|
||||
await httpContext.Response.WriteAsync(message, httpContext.RequestAborted).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the <see cref="UrlDecodeQueryFeature"/>.
|
||||
/// </summary>
|
||||
public class UrlDecodeQueryFeature : IQueryFeature
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="UrlDecodeQueryFeature"/>.
|
||||
/// </summary>
|
||||
public class UrlDecodeQueryFeature : IQueryFeature
|
||||
{
|
||||
private IQueryCollection? _store;
|
||||
|
||||
/// <summary>
|
||||
@ -80,5 +80,4 @@ namespace Jellyfin.Api.Middleware
|
||||
_store = new QueryCollection(pairs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jellyfin.Api.Middleware
|
||||
namespace Jellyfin.Api.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Handles WebSocket requests.
|
||||
/// </summary>
|
||||
public class WebSocketHandlerMiddleware
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles WebSocket requests.
|
||||
/// </summary>
|
||||
public class WebSocketHandlerMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
/// <summary>
|
||||
@ -36,5 +36,4 @@ namespace Jellyfin.Api.Middleware
|
||||
|
||||
await webSocketManager.WebSocketRequestHandler(httpContext).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,14 +5,14 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.ModelBinders
|
||||
namespace Jellyfin.Api.ModelBinders;
|
||||
|
||||
/// <summary>
|
||||
/// Comma delimited array model binder.
|
||||
/// Returns an empty array of specified type if there is no query parameter.
|
||||
/// </summary>
|
||||
public class CommaDelimitedArrayModelBinder : IModelBinder
|
||||
{
|
||||
/// <summary>
|
||||
/// Comma delimited array model binder.
|
||||
/// Returns an empty array of specified type if there is no query parameter.
|
||||
/// </summary>
|
||||
public class CommaDelimitedArrayModelBinder : IModelBinder
|
||||
{
|
||||
private readonly ILogger<CommaDelimitedArrayModelBinder> _logger;
|
||||
|
||||
/// <summary>
|
||||
@ -86,5 +86,4 @@ namespace Jellyfin.Api.ModelBinders
|
||||
|
||||
return typedValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user