diff options
| author | crobibero <cody@robibe.ro> | 2021-02-10 16:12:52 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2021-02-10 16:12:52 -0700 |
| commit | d5f0b046bb21dea0c120aa27f68fabc5947a8f1d (patch) | |
| tree | bc2c31e2967416858765f0b1a8be6ca1081ac245 /Jellyfin.Api/Attributes/AcceptsFileAttribute.cs | |
| parent | bd8c269ea2769a9684c7755633417e1e78d84a57 (diff) | |
Add image file accept to openapi
Diffstat (limited to 'Jellyfin.Api/Attributes/AcceptsFileAttribute.cs')
| -rw-r--r-- | Jellyfin.Api/Attributes/AcceptsFileAttribute.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Jellyfin.Api/Attributes/AcceptsFileAttribute.cs b/Jellyfin.Api/Attributes/AcceptsFileAttribute.cs new file mode 100644 index 000000000..49b6689cd --- /dev/null +++ b/Jellyfin.Api/Attributes/AcceptsFileAttribute.cs @@ -0,0 +1,28 @@ +using System; + +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> + public string[] GetContentTypes() => _contentTypes; + } +} |
