2021-11-16 15:31:57 +00:00
|
|
|
|
#pragma warning disable CA1813 // Avoid unsealed attributes
|
|
|
|
|
|
|
|
|
|
using System;
|
2021-02-10 23:12:52 +00:00
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Api.Attributes
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Internal produces image attribute.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
|
|
|
public class AcceptsFileAttribute : Attribute
|
|
|
|
|
{
|
|
|
|
|
private readonly string[] _contentTypes;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="AcceptsFileAttribute"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="contentTypes">Content types this endpoint produces.</param>
|
|
|
|
|
public AcceptsFileAttribute(params string[] contentTypes)
|
|
|
|
|
{
|
|
|
|
|
_contentTypes = contentTypes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the configured content types.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>the configured content types.</returns>
|
2023-01-04 15:01:31 +00:00
|
|
|
|
public string[] ContentTypes => _contentTypes;
|
2021-02-10 23:12:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|