diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-02-11 17:42:28 +0100 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2021-02-21 13:30:31 -0500 |
| commit | d53120602cadb57431bed8f7e74c1874179ac1f1 (patch) | |
| tree | 13ddd27edcba48f3ca2830cb8bc799ccecba96e9 /Jellyfin.Api/Attributes/AcceptsFileAttribute.cs | |
| parent | da09257d58c33dce24aafb05dfdadad05e642059 (diff) | |
Merge pull request #5208 from crobibero/api-post-image
Add image file accept to openapi
(cherry picked from commit 76d66e0dee62998a211c4f720e8f2800458d7f23)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
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; + } +} |
