Migrate to file-scoped namespaces

This commit is contained in:
Shadowghost 2023-01-31 12:18:10 +01:00
parent 58b3945805
commit f5f890e685
163 changed files with 23939 additions and 24102 deletions

View File

@ -2,14 +2,14 @@
using System; 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; private readonly string[] _contentTypes;
/// <summary> /// <summary>
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
/// </summary> /// </summary>
/// <returns>the configured content types.</returns> /// <returns>the configured content types.</returns>
public string[] ContentTypes => _contentTypes; public string[] ContentTypes => _contentTypes;
}
} }

View File

@ -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/*"; private const string ContentType = "image/*";
/// <summary> /// <summary>
@ -14,5 +14,4 @@
: base(ContentType) : base(ContentType)
{ {
} }
}
} }

View File

@ -2,13 +2,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Routing; 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" }; private static readonly IEnumerable<string> _supportedMethods = new[] { "SUBSCRIBE" };
/// <summary> /// <summary>
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
public HttpSubscribeAttribute(string template) public HttpSubscribeAttribute(string template)
: base(_supportedMethods, template) : base(_supportedMethods, template)
=> ArgumentNullException.ThrowIfNull(template); => ArgumentNullException.ThrowIfNull(template);
}
} }

View File

@ -2,13 +2,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Routing; 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" }; private static readonly IEnumerable<string> _supportedMethods = new[] { "UNSUBSCRIBE" };
/// <summary> /// <summary>
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
public HttpUnsubscribeAttribute(string template) public HttpUnsubscribeAttribute(string template)
: base(_supportedMethods, template) : base(_supportedMethods, template)
=> ArgumentNullException.ThrowIfNull(template); => ArgumentNullException.ThrowIfNull(template);
}
} }

View File

@ -1,12 +1,11 @@
using System; 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
{
}
} }

View File

@ -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/*"; private const string ContentType = "audio/*";
/// <summary> /// <summary>
@ -14,5 +14,4 @@
: base(ContentType) : base(ContentType)
{ {
} }
}
} }

View File

@ -2,14 +2,14 @@
using System; 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; private readonly string[] _contentTypes;
/// <summary> /// <summary>
@ -26,5 +26,4 @@ namespace Jellyfin.Api.Attributes
/// </summary> /// </summary>
/// <returns>the configured content types.</returns> /// <returns>the configured content types.</returns>
public string[] ContentTypes => _contentTypes; public string[] ContentTypes => _contentTypes;
}
} }

View File

@ -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/*"; private const string ContentType = "image/*";
/// <summary> /// <summary>
@ -14,5 +14,4 @@
: base(ContentType) : base(ContentType)
{ {
} }
}
} }

View File

@ -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"; private const string ContentType = "application/x-mpegURL";
/// <summary> /// <summary>
@ -14,5 +14,4 @@
: base(ContentType) : base(ContentType)
{ {
} }
}
} }

View File

@ -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/*"; private const string ContentType = "video/*";
/// <summary> /// <summary>
@ -14,5 +14,4 @@
: base(ContentType) : base(ContentType)
{ {
} }
}
} }

View File

@ -4,19 +4,19 @@ using Jellyfin.Api.Results;
using Jellyfin.Extensions.Json; using Jellyfin.Extensions.Json;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Api namespace Jellyfin.Api;
{
/// <summary> /// <summary>
/// Base api controller for the API setting a default route. /// Base api controller for the API setting a default route.
/// </summary> /// </summary>
[ApiController] [ApiController]
[Route("[controller]")] [Route("[controller]")]
[Produces( [Produces(
MediaTypeNames.Application.Json, MediaTypeNames.Application.Json,
JsonDefaults.CamelCaseMediaType, JsonDefaults.CamelCaseMediaType,
JsonDefaults.PascalCaseMediaType)] JsonDefaults.PascalCaseMediaType)]
public class BaseJellyfinApiController : ControllerBase public class BaseJellyfinApiController : ControllerBase
{ {
/// <summary> /// <summary>
/// Create a new <see cref="OkResult{T}"/>. /// Create a new <see cref="OkResult{T}"/>.
/// </summary> /// </summary>
@ -34,5 +34,4 @@ namespace Jellyfin.Api
/// <returns>The <see cref="ActionResult{T}"/>.</returns> /// <returns>The <see cref="ActionResult{T}"/>.</returns>
protected ActionResult<T> Ok<T>(T value) protected ActionResult<T> Ok<T>(T value)
=> new OkResult<T>(value); => new OkResult<T>(value);
}
} }

View File

@ -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> /// <summary>
/// Scheme name for the custom legacy authentication. /// Scheme name for the custom legacy authentication.
/// </summary> /// </summary>
public const string CustomAuthentication = "CustomAuthentication"; public const string CustomAuthentication = "CustomAuthentication";
}
} }

View File

@ -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> /// <summary>
/// User Id. /// User Id.
/// </summary> /// </summary>
@ -39,5 +39,4 @@
/// Is Api Key. /// Is Api Key.
/// </summary> /// </summary>
public const string IsApiKey = "Jellyfin-IsApiKey"; public const string IsApiKey = "Jellyfin-IsApiKey";
}
} }

View File

@ -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> /// <summary>
/// Policy name for default authorization. /// Policy name for default authorization.
/// </summary> /// </summary>
@ -74,5 +74,4 @@ namespace Jellyfin.Api.Constants
/// Policy name for accessing a SyncPlay group. /// Policy name for accessing a SyncPlay group.
/// </summary> /// </summary>
public const string SyncPlayIsInGroup = "SyncPlayIsInGroup"; public const string SyncPlayIsInGroup = "SyncPlayIsInGroup";
}
} }

View File

@ -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> /// <summary>
/// Guest user. /// Guest user.
/// </summary> /// </summary>
@ -19,5 +19,4 @@ namespace Jellyfin.Api.Constants
/// Administrator user with elevated privileges. /// Administrator user with elevated privileges.
/// </summary> /// </summary>
public const string Administrator = "Administrator"; public const string Administrator = "Administrator";
}
} }

View File

@ -8,15 +8,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly IActivityManager _activityManager;
/// <summary> /// <summary>
@ -53,5 +53,4 @@ namespace Jellyfin.Api.Controllers
HasUserId = hasUserId HasUserId = hasUserId
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }
}
} }

View File

@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly IAuthenticationManager _authenticationManager;
/// <summary> /// <summary>
@ -72,5 +72,4 @@ namespace Jellyfin.Api.Controllers
return NoContent(); return NoContent();
} }
}
} }

View File

@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -476,5 +476,4 @@ namespace Jellyfin.Api.Controllers
return _dtoService.GetBaseItemDto(item, dtoOptions); return _dtoService.GetBaseItemDto(item, dtoOptions);
} }
}
} }

View File

@ -10,14 +10,14 @@ using MediaBrowser.Model.Dlna;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 AudioHelper _audioHelper;
private readonly TranscodingJobType _transcodingJobType = TranscodingJobType.Progressive; private readonly TranscodingJobType _transcodingJobType = TranscodingJobType.Progressive;
@ -360,5 +360,4 @@ namespace Jellyfin.Api.Controllers
return await _audioHelper.GetAudioStream(_transcodingJobType, streamingRequest).ConfigureAwait(false); return await _audioHelper.GetAudioStream(_transcodingJobType, streamingRequest).ConfigureAwait(false);
} }
}
} }

View File

@ -4,13 +4,13 @@ using MediaBrowser.Model.Branding;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly IServerConfigurationManager _serverConfigurationManager;
/// <summary> /// <summary>
@ -53,5 +53,4 @@ namespace Jellyfin.Api.Controllers
var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding"); var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");
return options.CustomCss ?? string.Empty; return options.CustomCss ?? string.Empty;
} }
}
} }

View File

@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IChannelManager _channelManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -247,5 +247,4 @@ namespace Jellyfin.Api.Controllers
return await _channelManager.GetLatestChannelItems(query, CancellationToken.None).ConfigureAwait(false); return await _channelManager.GetLatestChannelItems(query, CancellationToken.None).ConfigureAwait(false);
} }
}
} }

View File

@ -11,14 +11,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 const int MaxDocumentSize = 1_000_000;
private readonly IClientEventLogger _clientEventLogger; private readonly IClientEventLogger _clientEventLogger;
private readonly IServerConfigurationManager _serverConfigurationManager; private readonly IServerConfigurationManager _serverConfigurationManager;
@ -77,5 +77,4 @@ namespace Jellyfin.Api.Controllers
return (clientName, clientVersion); return (clientName, clientVersion);
} }
}
} }

View File

@ -11,15 +11,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ICollectionManager _collectionManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -107,5 +107,4 @@ namespace Jellyfin.Api.Controllers
await _collectionManager.RemoveFromCollectionAsync(collectionId, ids).ConfigureAwait(false); await _collectionManager.RemoveFromCollectionAsync(collectionId, ids).ConfigureAwait(false);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -13,15 +13,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IServerConfigurationManager _configurationManager;
private readonly IMediaEncoder _mediaEncoder; private readonly IMediaEncoder _mediaEncoder;
@ -132,5 +132,4 @@ namespace Jellyfin.Api.Controllers
_mediaEncoder.UpdateEncoderPath(mediaEncoderPath.Path, mediaEncoderPath.PathType); _mediaEncoder.UpdateEncoderPath(mediaEncoderPath.Path, mediaEncoderPath.PathType);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -14,14 +14,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 ILogger<DashboardController> _logger;
private readonly IPluginManager _pluginManager; private readonly IPluginManager _pluginManager;
@ -112,5 +112,4 @@ namespace Jellyfin.Api.Controllers
{ {
return _pluginManager.Plugins.SelectMany(GetPluginPages); return _pluginManager.Plugins.SelectMany(GetPluginPages);
} }
}
} }

View File

@ -13,14 +13,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IDeviceManager _deviceManager;
private readonly ISessionManager _sessionManager; private readonly ISessionManager _sessionManager;
@ -137,5 +137,4 @@ namespace Jellyfin.Api.Controllers
return NoContent(); return NoContent();
} }
}
} }

View File

@ -14,14 +14,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IDisplayPreferencesManager _displayPreferencesManager;
private readonly ILogger<DisplayPreferencesController> _logger; private readonly ILogger<DisplayPreferencesController> _logger;
@ -210,5 +210,4 @@ namespace Jellyfin.Api.Controllers
return NoContent(); return NoContent();
} }
}
} }

View File

@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly IDlnaManager _dlnaManager;
/// <summary> /// <summary>
@ -129,5 +129,4 @@ namespace Jellyfin.Api.Controllers
_dlnaManager.UpdateProfile(profileId, deviceProfile); _dlnaManager.UpdateProfile(profileId, deviceProfile);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -14,16 +14,16 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IDlnaManager _dlnaManager;
private readonly IContentDirectory _contentDirectory; private readonly IContentDirectory _contentDirectory;
private readonly IConnectionManager _connectionManager; private readonly IConnectionManager _connectionManager;
@ -320,5 +320,4 @@ namespace Jellyfin.Api.Controllers
return dlnaEventManager.CancelEventSubscription(subscriptionId); return dlnaEventManager.CancelEventSubscription(subscriptionId);
} }
}
} }

View File

@ -30,15 +30,15 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 DefaultVodEncoderPreset = "veryfast";
private const string DefaultEventEncoderPreset = "superfast"; private const string DefaultEventEncoderPreset = "superfast";
private const TranscodingJobType TranscodingJobType = MediaBrowser.Controller.MediaEncoding.TranscodingJobType.Hls; 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); _logger.LogError(ex, "Error deleting partial stream file(s) {Path}", path);
} }
} }
}
} }

View File

@ -12,14 +12,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 char UncSeparator = '\\';
private const string UncStartPrefix = @"\\"; private const string UncStartPrefix = @"\\";
@ -193,5 +193,4 @@ namespace Jellyfin.Api.Controllers
{ {
return new DefaultDirectoryBrowserInfoDto(); return new DefaultDirectoryBrowserInfoDto();
} }
}
} }

View File

@ -12,15 +12,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -212,5 +212,4 @@ namespace Jellyfin.Api.Controllers
return filters; return filters;
} }
}
} }

View File

@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Genre = MediaBrowser.Controller.Entities.Genre; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -207,5 +207,4 @@ namespace Jellyfin.Api.Controllers
return result; return result;
} }
}
} }

View File

@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IFileSystem _fileSystem;
private readonly IServerConfigurationManager _serverConfigurationManager; private readonly IServerConfigurationManager _serverConfigurationManager;
private readonly TranscodingJobHelper _transcodingJobHelper; private readonly TranscodingJobHelper _transcodingJobHelper;
@ -188,5 +188,4 @@ namespace Jellyfin.Api.Controllers
return FileStreamResponseHelpers.GetStaticFileResult(path, MimeTypes.GetMimeType(path)); return FileStreamResponseHelpers.GetStaticFileResult(path, MimeTypes.GetMimeType(path));
} }
}
} }

View File

@ -30,14 +30,14 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IProviderManager _providerManager; private readonly IProviderManager _providerManager;
@ -2096,5 +2096,4 @@ namespace Jellyfin.Api.Controllers
return PhysicalFile(imagePath, imageContentType ?? MediaTypeNames.Text.Plain); return PhysicalFile(imagePath, imageContentType ?? MediaTypeNames.Text.Plain);
} }
}
} }

View File

@ -16,15 +16,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -357,5 +357,4 @@ namespace Jellyfin.Api.Controllers
return result; return result;
} }
}
} }

View File

@ -18,15 +18,15 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IProviderManager _providerManager;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -270,5 +270,4 @@ namespace Jellyfin.Api.Controllers
return NoContent(); return NoContent();
} }
}
} }

View File

@ -9,15 +9,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IProviderManager _providerManager; private readonly IProviderManager _providerManager;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
@ -82,5 +82,4 @@ namespace Jellyfin.Api.Controllers
_providerManager.QueueRefresh(item.Id, refreshOptions, RefreshPriority.High); _providerManager.QueueRefresh(item.Id, refreshOptions, RefreshPriority.High);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IProviderManager _providerManager; private readonly IProviderManager _providerManager;
private readonly ILocalizationManager _localizationManager; private readonly ILocalizationManager _localizationManager;
@ -445,5 +445,4 @@ namespace Jellyfin.Api.Controllers
return list; return list;
} }
}
} }

View File

@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly ILocalizationManager _localization; private readonly ILocalizationManager _localization;
@ -869,5 +869,4 @@ namespace Jellyfin.Api.Controllers
itemsResult.TotalRecordCount, itemsResult.TotalRecordCount,
returnItems); returnItems);
} }
}
} }

View File

@ -37,14 +37,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IProviderManager _providerManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -968,5 +968,4 @@ namespace Jellyfin.Api.Controllers
return metadataOptions.Any(i => !i.DisabledImageFetchers.Contains(name, StringComparison.OrdinalIgnoreCase)); return metadataOptions.Any(i => !i.DisabledImageFetchers.Contains(name, StringComparison.OrdinalIgnoreCase));
} }
}
} }

View File

@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IServerApplicationPaths _appPaths;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly ILibraryMonitor _libraryMonitor; private readonly ILibraryMonitor _libraryMonitor;
@ -323,5 +323,4 @@ namespace Jellyfin.Api.Controllers
collectionFolder.UpdateLibraryOptions(request.LibraryOptions); collectionFolder.UpdateLibraryOptions(request.LibraryOptions);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -35,13 +35,13 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILiveTvManager _liveTvManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IHttpClientFactory _httpClientFactory; 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."); throw new SecurityException("The current user does not have permission to manage live tv.");
} }
} }
}
} }

View File

@ -6,14 +6,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly ILocalizationManager _localization;
/// <summary> /// <summary>
@ -72,5 +72,4 @@ namespace Jellyfin.Api.Controllers
{ {
return Ok(_localization.GetLocalizationOptions()); return Ok(_localization.GetLocalizationOptions());
} }
}
} }

View File

@ -19,15 +19,15 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.Extensions.Logging; 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 IMediaSourceManager _mediaSourceManager;
private readonly IDeviceManager _deviceManager; private readonly IDeviceManager _deviceManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -309,5 +309,4 @@ namespace Jellyfin.Api.Controllers
ArrayPool<byte>.Shared.Return(buffer); ArrayPool<byte>.Shared.Return(buffer);
} }
} }
}
} }

View File

@ -18,14 +18,14 @@ using MediaBrowser.Model.Querying;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -322,5 +322,4 @@ namespace Jellyfin.Api.Controllers
.Select(i => i.Name) .Select(i => i.Name)
.DistinctNames(); .DistinctNames();
} }
}
} }

View File

@ -18,14 +18,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -194,5 +194,4 @@ namespace Jellyfin.Api.Controllers
return result; return result;
} }
}
} }

View File

@ -11,15 +11,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IInstallationManager _installationManager;
private readonly IServerConfigurationManager _serverConfigurationManager; private readonly IServerConfigurationManager _serverConfigurationManager;
@ -163,5 +163,4 @@ namespace Jellyfin.Api.Controllers
_serverConfigurationManager.SaveConfiguration(); _serverConfigurationManager.SaveConfiguration();
return NoContent(); return NoContent();
} }
}
} }

View File

@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -135,5 +135,4 @@ namespace Jellyfin.Api.Controllers
return _dtoService.GetBaseItemDto(item, dtoOptions); return _dtoService.GetBaseItemDto(item, dtoOptions);
} }
}
} }

View File

@ -20,14 +20,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding; 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 IPlaylistManager _playlistManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -217,5 +217,4 @@ namespace Jellyfin.Api.Controllers
return result; return result;
} }
}
} }

View File

@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IUserManager _userManager;
private readonly IUserDataManager _userDataRepository; private readonly IUserDataManager _userDataRepository;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -378,5 +378,4 @@ namespace Jellyfin.Api.Controllers
return method; return method;
} }
}
} }

View File

@ -17,14 +17,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IInstallationManager _installationManager;
private readonly IPluginManager _pluginManager; private readonly IPluginManager _pluginManager;
private readonly JsonSerializerOptions _serializerOptions; private readonly JsonSerializerOptions _serializerOptions;
@ -262,5 +262,4 @@ namespace Jellyfin.Api.Controllers
return NotFound(); return NotFound();
} }
}
} }

View File

@ -13,13 +13,13 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IQuickConnect _quickConnect;
private readonly IAuthorizationContext _authContext; private readonly IAuthorizationContext _authContext;
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Controllers
return Unauthorized("Quick connect is disabled"); return Unauthorized("Quick connect is disabled");
} }
} }
}
} }

View File

@ -15,14 +15,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IProviderManager _providerManager;
private readonly IServerApplicationPaths _applicationPaths; private readonly IServerApplicationPaths _applicationPaths;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -175,5 +175,4 @@ namespace Jellyfin.Api.Controllers
{ {
return Path.Combine(_applicationPaths.CachePath, "remote-images", filename.Substring(0, 1), filename); return Path.Combine(_applicationPaths.CachePath, "remote-images", filename.Substring(0, 1), filename);
} }
}
} }

View File

@ -8,14 +8,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly ITaskManager _taskManager;
/// <summary> /// <summary>
@ -157,5 +157,4 @@ namespace Jellyfin.Api.Controllers
task.Triggers = triggerInfos; task.Triggers = triggerInfos;
return NoContent(); return NoContent();
} }
}
} }

View File

@ -20,15 +20,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ISearchEngine _searchEngine;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -262,5 +262,4 @@ namespace Jellyfin.Api.Controllers
{ {
return item.GetParents().OfType<T>().FirstOrDefault(i => i.HasImage(type)); return item.GetParents().OfType<T>().FirstOrDefault(i => i.HasImage(type));
} }
}
} }

View File

@ -19,14 +19,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ISessionManager _sessionManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDeviceManager _deviceManager; private readonly IDeviceManager _deviceManager;
@ -494,5 +494,4 @@ namespace Jellyfin.Api.Controllers
{ {
return _userManager.GetPasswordResetProviders(); return _userManager.GetPasswordResetProviders();
} }
}
} }

View File

@ -10,14 +10,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IServerConfigurationManager _config;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -146,5 +146,4 @@ namespace Jellyfin.Api.Controllers
return NoContent(); return NoContent();
} }
}
} }

View File

@ -16,14 +16,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -152,5 +152,4 @@ namespace Jellyfin.Api.Controllers
return _dtoService.GetBaseItemDto(item, dtoOptions); return _dtoService.GetBaseItemDto(item, dtoOptions);
} }
}
} }

View File

@ -30,14 +30,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IServerConfigurationManager _serverConfigurationManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly ISubtitleManager _subtitleManager; private readonly ISubtitleManager _subtitleManager;
@ -547,5 +547,4 @@ namespace Jellyfin.Api.Controllers
// returning HTTP 204 will break the SubtitlesOctopus // returning HTTP 204 will break the SubtitlesOctopus
return Ok(); return Ok();
} }
}
} }

View File

@ -13,15 +13,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IDtoService _dtoService;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -88,5 +88,4 @@ namespace Jellyfin.Api.Controllers
result.TotalRecordCount, result.TotalRecordCount,
dtoList); dtoList);
} }
}
} }

View File

@ -16,14 +16,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ISessionManager _sessionManager;
private readonly ISyncPlayManager _syncPlayManager; private readonly ISyncPlayManager _syncPlayManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
@ -420,5 +420,4 @@ namespace Jellyfin.Api.Controllers
_syncPlayManager.HandleRequest(currentSession, syncPlayRequest, CancellationToken.None); _syncPlayManager.HandleRequest(currentSession, syncPlayRequest, CancellationToken.None);
return NoContent(); return NoContent();
} }
}
} }

View File

@ -20,13 +20,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IServerApplicationHost _appHost;
private readonly IApplicationPaths _appPaths; private readonly IApplicationPaths _appPaths;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
@ -219,5 +219,4 @@ namespace Jellyfin.Api.Controllers
.Select(i => new WakeOnLanInfo(i)); .Select(i => new WakeOnLanInfo(i));
return Ok(result); return Ok(result);
} }
}
} }

View File

@ -3,14 +3,14 @@ using MediaBrowser.Model.SyncPlay;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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> /// <summary>
/// Gets the current UTC time. /// Gets the current UTC time.
/// </summary> /// </summary>
@ -30,5 +30,4 @@ namespace Jellyfin.Api.Controllers
// information being sent. On the other hand it enables future additions. // information being sent. On the other hand it enables future additions.
return new UtcTimeResponse(requestReceptionTime, responseTransmissionTime); return new UtcTimeResponse(requestReceptionTime, responseTransmissionTime);
} }
}
} }

View File

@ -10,14 +10,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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; private readonly ItemsController _itemsController;
/// <summary> /// <summary>
@ -295,5 +295,4 @@ namespace Jellyfin.Api.Controllers
enableTotalRecordCount, enableTotalRecordCount,
enableImages); enableImages);
} }
}
} }

View File

@ -19,15 +19,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -380,5 +380,4 @@ namespace Jellyfin.Api.Controllers
return items; return items;
} }
}
} }

View File

@ -20,14 +20,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 ILibraryManager _libraryManager;
private readonly ILogger<UniversalAudioController> _logger; private readonly ILogger<UniversalAudioController> _logger;
private readonly MediaInfoHelper _mediaInfoHelper; private readonly MediaInfoHelper _mediaInfoHelper;
@ -336,5 +336,4 @@ namespace Jellyfin.Api.Controllers
return deviceProfile; return deviceProfile;
} }
}
} }

View File

@ -25,14 +25,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; 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 IUserManager _userManager;
private readonly ISessionManager _sessionManager; private readonly ISessionManager _sessionManager;
private readonly INetworkManager _networkManager; private readonly INetworkManager _networkManager;
@ -584,5 +584,4 @@ namespace Jellyfin.Api.Controllers
return result; return result;
} }
}
} }

View File

@ -23,15 +23,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IUserManager _userManager;
private readonly IUserDataManager _userDataRepository; private readonly IUserDataManager _userDataRepository;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -424,5 +424,4 @@ namespace Jellyfin.Api.Controllers
return NotFound(); return NotFound();
} }
}
} }

View File

@ -17,15 +17,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IUserManager _userManager;
private readonly IUserViewManager _userViewManager; private readonly IUserViewManager _userViewManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Controllers
.OrderBy(i => i.Name) .OrderBy(i => i.Name)
.AsEnumerable()); .AsEnumerable());
} }
}
} }

View File

@ -10,14 +10,14 @@ using MediaBrowser.Controller.MediaEncoding;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IAttachmentExtractor _attachmentExtractor; private readonly IAttachmentExtractor _attachmentExtractor;
@ -78,5 +78,4 @@ namespace Jellyfin.Api.Controllers
return NotFound(e.Message); return NotFound(e.Message);
} }
} }
}
} }

View File

@ -32,13 +32,13 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -671,5 +671,4 @@ namespace Jellyfin.Api.Controllers
context, context,
streamOptions); streamOptions);
} }
}
} }

View File

@ -19,14 +19,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
@ -222,5 +222,4 @@ namespace Jellyfin.Api.Controllers
.Distinct() .Distinct()
.Select(year => _libraryManager.GetYear(year)); .Select(year => _libraryManager.GetYear(year));
} }
}
} }

View File

@ -7,13 +7,13 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using Microsoft.AspNetCore.Http; 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> /// <summary>
/// Add additional fields depending on client. /// Add additional fields depending on client.
/// </summary> /// </summary>
@ -112,5 +112,4 @@ namespace Jellyfin.Api.Extensions
return dtoOptions; return dtoOptions;
} }
}
} }

View File

@ -2,13 +2,13 @@ using Jellyfin.Extensions.Json;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers; 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> /// <summary>
/// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class. /// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class.
/// </summary> /// </summary>
@ -17,5 +17,4 @@ namespace Jellyfin.Api.Formatters
SupportedMediaTypes.Clear(); SupportedMediaTypes.Clear();
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.CamelCaseMediaType)); SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.CamelCaseMediaType));
} }
}
} }

View File

@ -3,13 +3,13 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters; 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> /// <summary>
/// Initializes a new instance of the <see cref="CssOutputFormatter"/> class. /// Initializes a new instance of the <see cref="CssOutputFormatter"/> class.
/// </summary> /// </summary>
@ -32,5 +32,4 @@ namespace Jellyfin.Api.Formatters
var stringResponse = context.Object?.ToString(); var stringResponse = context.Object?.ToString();
return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
} }
}
} }

View File

@ -3,13 +3,13 @@ using Jellyfin.Extensions.Json;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers; 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> /// <summary>
/// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class. /// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class.
/// </summary> /// </summary>
@ -20,5 +20,4 @@ namespace Jellyfin.Api.Formatters
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json)); SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json));
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.PascalCaseMediaType)); SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.PascalCaseMediaType));
} }
}
} }

View File

@ -4,13 +4,13 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters; 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> /// <summary>
/// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class. /// Initializes a new instance of the <see cref="XmlOutputFormatter"/> class.
/// </summary> /// </summary>
@ -29,5 +29,4 @@ namespace Jellyfin.Api.Formatters
var stringResponse = context.Object?.ToString(); var stringResponse = context.Object?.ToString();
return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); return stringResponse is null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse);
} }
}
} }

View File

@ -16,13 +16,13 @@ using MediaBrowser.Model.Net;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; 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 IDlnaManager _dlnaManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -176,5 +176,4 @@ namespace Jellyfin.Api.Helpers
transcodingJobType, transcodingJobType,
cancellationTokenSource).ConfigureAwait(false); cancellationTokenSource).ConfigureAwait(false);
} }
}
} }

View File

@ -25,13 +25,13 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; 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 ILibraryManager _libraryManager;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDlnaManager _dlnaManager; private readonly IDlnaManager _dlnaManager;
@ -745,5 +745,4 @@ namespace Jellyfin.Api.Helpers
return newPlaylist.Contains(",fLaC\"", StringComparison.Ordinal) ? newPlaylist : string.Empty; return newPlaylist.Contains(",fLaC\"", StringComparison.Ordinal) ? newPlaylist : string.Empty;
} }
}
} }

View File

@ -11,13 +11,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers; 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> /// <summary>
/// Returns a static file from a remote source. /// Returns a static file from a remote source.
/// </summary> /// </summary>
@ -116,5 +116,4 @@ namespace Jellyfin.Api.Helpers
transcodingLock.Release(); transcodingLock.Release();
} }
} }
}
} }

View File

@ -2,13 +2,13 @@
using System.Globalization; using System.Globalization;
using System.Text; 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> /// <summary>
/// Codec name for MP3. /// Codec name for MP3.
/// </summary> /// </summary>
@ -179,5 +179,4 @@ namespace Jellyfin.Api.Helpers
return result.ToString(); return result.ToString();
} }
}
} }

View File

@ -8,13 +8,13 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging; 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> /// <summary>
/// Waits for a minimum number of segments to be available. /// Waits for a minimum number of segments to be available.
/// </summary> /// </summary>
@ -134,5 +134,4 @@ namespace Jellyfin.Api.Helpers
return text; return text;
} }
}
} }

View File

@ -25,13 +25,13 @@ using MediaBrowser.Model.Session;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; 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 IUserManager _userManager;
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IMediaSourceManager _mediaSourceManager; private readonly IMediaSourceManager _mediaSourceManager;
@ -496,5 +496,4 @@ namespace Jellyfin.Api.Helpers
return maxBitrate; return maxBitrate;
} }
}
} }

View File

@ -6,13 +6,13 @@ using System.Threading.Tasks;
using Jellyfin.Api.Models.PlaybackDtos; using Jellyfin.Api.Models.PlaybackDtos;
using MediaBrowser.Model.IO; 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 Stream _stream;
private readonly TranscodingJobDto? _job; private readonly TranscodingJobDto? _job;
private readonly TranscodingJobHelper? _transcodingJobHelper; 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 // but don't keep it open indefinitely if it isn't reading anything
return bytesRead > 0 || (_job?.HasExited ?? elapsed >= _timeoutMs); return bytesRead > 0 || (_job?.HasExited ?? elapsed >= _timeoutMs);
} }
}
} }

View File

@ -16,13 +16,13 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using Microsoft.AspNetCore.Http; 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> /// <summary>
/// Get Order By. /// Get Order By.
/// </summary> /// </summary>
@ -144,5 +144,4 @@ namespace Jellyfin.Api.Helpers
result.TotalRecordCount, result.TotalRecordCount,
dtos.ToArray()); dtos.ToArray());
} }
}
} }

View File

@ -22,13 +22,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers; 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> /// <summary>
/// Gets the current streaming state. /// Gets the current streaming state.
/// </summary> /// </summary>
@ -779,5 +779,4 @@ namespace Jellyfin.Api.Helpers
} }
} }
} }
}
} }

View File

@ -27,13 +27,13 @@ using MediaBrowser.Model.Session;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; 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> /// <summary>
/// The active transcoding jobs. /// The active transcoding jobs.
/// </summary> /// </summary>
@ -291,7 +291,7 @@ namespace Jellyfin.Api.Helpers
lock (job.ProcessLock!) 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(); job.TranscodingThrottler?.Stop().GetAwaiter().GetResult();
var process = job.Process; var process = job.Process;
@ -317,7 +317,7 @@ namespace Jellyfin.Api.Helpers
{ {
} }
} }
#pragma warning restore CA1849 #pragma warning restore CA1849
} }
if (delete(job.Path!)) if (delete(job.Path!))
@ -910,5 +910,4 @@ namespace Jellyfin.Api.Helpers
_sessionManager.PlaybackStart -= OnPlaybackProgress; _sessionManager.PlaybackStart -= OnPlaybackProgress;
} }
} }
}
} }

View File

@ -7,13 +7,13 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions; 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 RequestDelegate _next;
private readonly ILogger<BaseUrlRedirectionMiddleware> _logger; private readonly ILogger<BaseUrlRedirectionMiddleware> _logger;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
@ -77,5 +77,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -12,13 +12,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging; 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 RequestDelegate _next;
private readonly ILogger<ExceptionMiddleware> _logger; private readonly ILogger<ExceptionMiddleware> _logger;
private readonly IServerConfigurationManager _configuration; private readonly IServerConfigurationManager _configuration;
@ -147,5 +147,4 @@ namespace Jellyfin.Api.Middleware
string.Empty, string.Empty,
StringComparison.OrdinalIgnoreCase); StringComparison.OrdinalIgnoreCase);
} }
}
} }

View File

@ -4,13 +4,13 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using Microsoft.AspNetCore.Http; 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; private readonly RequestDelegate _next;
/// <summary> /// <summary>
@ -46,5 +46,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -5,13 +5,13 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using Microsoft.AspNetCore.Http; 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; private readonly RequestDelegate _next;
/// <summary> /// <summary>
@ -41,5 +41,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -3,13 +3,13 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; 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 EmbyPath = "/emby";
private const string MediabrowserPath = "/mediabrowser"; private const string MediabrowserPath = "/mediabrowser";
@ -50,5 +50,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -2,13 +2,13 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features; 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; private readonly RequestDelegate _next;
/// <summary> /// <summary>
@ -35,5 +35,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -7,13 +7,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.Extensions.Logging; 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 const string ResponseHeaderResponseTime = "X-Response-Time-ms";
private readonly RequestDelegate _next; private readonly RequestDelegate _next;
@ -65,5 +65,4 @@ namespace Jellyfin.Api.Middleware
// Call the next delegate/middleware in the pipeline // Call the next delegate/middleware in the pipeline
await this._next(context).ConfigureAwait(false); await this._next(context).ConfigureAwait(false);
} }
}
} }

View File

@ -3,13 +3,13 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; 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 RequestDelegate _next;
private readonly ILogger<RobotsRedirectionMiddleware> _logger; private readonly ILogger<RobotsRedirectionMiddleware> _logger;
@ -43,5 +43,4 @@ namespace Jellyfin.Api.Middleware
await _next(httpContext).ConfigureAwait(false); await _next(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -5,13 +5,13 @@ using MediaBrowser.Controller;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using Microsoft.AspNetCore.Http; 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; private readonly RequestDelegate _next;
/// <summary> /// <summary>
@ -47,5 +47,4 @@ namespace Jellyfin.Api.Middleware
httpContext.Response.ContentType = MediaTypeNames.Text.Html; httpContext.Response.ContentType = MediaTypeNames.Text.Html;
await httpContext.Response.WriteAsync(message, httpContext.RequestAborted).ConfigureAwait(false); await httpContext.Response.WriteAsync(message, httpContext.RequestAborted).ConfigureAwait(false);
} }
}
} }

View File

@ -6,13 +6,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Primitives; 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; private IQueryCollection? _store;
/// <summary> /// <summary>
@ -80,5 +80,4 @@ namespace Jellyfin.Api.Middleware
_store = new QueryCollection(pairs); _store = new QueryCollection(pairs);
} }
} }
}
} }

View File

@ -2,13 +2,13 @@ using System.Threading.Tasks;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using Microsoft.AspNetCore.Http; 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; private readonly RequestDelegate _next;
/// <summary> /// <summary>
@ -36,5 +36,4 @@ namespace Jellyfin.Api.Middleware
await webSocketManager.WebSocketRequestHandler(httpContext).ConfigureAwait(false); await webSocketManager.WebSocketRequestHandler(httpContext).ConfigureAwait(false);
} }
}
} }

View File

@ -5,14 +5,14 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.Extensions.Logging; 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; private readonly ILogger<CommaDelimitedArrayModelBinder> _logger;
/// <summary> /// <summary>
@ -86,5 +86,4 @@ namespace Jellyfin.Api.ModelBinders
return typedValues; return typedValues;
} }
}
} }

Some files were not shown because too many files have changed in this diff Show More