diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-09-09 20:20:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-09 20:20:35 +0000 |
| commit | 621f3b705052f628e27fb975a8bb809853742ad8 (patch) | |
| tree | d7c84c5598aafdc2d3fd502b940339423e84ff33 /Jellyfin.Api/Attributes/ProducesFileAttribute.cs | |
| parent | b76d4ba454c43cc6293b733f2bba363e34a9bf5e (diff) | |
| parent | 25ac778a79c7ff39433db2acd92788e26228879f (diff) | |
Merge pull request #4037 from crobibero/api-stream-return
Set openapi schema type to file where possible
Diffstat (limited to 'Jellyfin.Api/Attributes/ProducesFileAttribute.cs')
| -rw-r--r-- | Jellyfin.Api/Attributes/ProducesFileAttribute.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Jellyfin.Api/Attributes/ProducesFileAttribute.cs b/Jellyfin.Api/Attributes/ProducesFileAttribute.cs new file mode 100644 index 000000000..62a576ede --- /dev/null +++ b/Jellyfin.Api/Attributes/ProducesFileAttribute.cs @@ -0,0 +1,28 @@ +using System; + +namespace Jellyfin.Api.Attributes +{ + /// <summary> + /// Internal produces image attribute. + /// </summary> + [AttributeUsage(AttributeTargets.Method)] + public class ProducesFileAttribute : Attribute + { + private readonly string[] _contentTypes; + + /// <summary> + /// Initializes a new instance of the <see cref="ProducesFileAttribute"/> class. + /// </summary> + /// <param name="contentTypes">Content types this endpoint produces.</param> + public ProducesFileAttribute(params string[] contentTypes) + { + _contentTypes = contentTypes; + } + + /// <summary> + /// Gets the configured content types. + /// </summary> + /// <returns>the configured content types.</returns> + public string[] GetContentTypes() => _contentTypes; + } +} |
