mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-13 13:46:24 +00:00
made compression and caching available to plugin api endpoints
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using MediaBrowser.Model.Logging;
|
||||
using ServiceStack.Service;
|
||||
using ServiceStack.ServiceHost;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -9,7 +11,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
/// <summary>
|
||||
/// Class StreamWriter
|
||||
/// </summary>
|
||||
public class StreamWriter : IStreamWriter
|
||||
public class StreamWriter : IStreamWriter, IHasOptions
|
||||
{
|
||||
private ILogger Logger { get; set; }
|
||||
|
||||
@@ -19,15 +21,36 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
/// <value>The source stream.</value>
|
||||
public Stream SourceStream { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The _options
|
||||
/// </summary>
|
||||
private readonly IDictionary<string, string> _options = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// Gets the options.
|
||||
/// </summary>
|
||||
/// <value>The options.</value>
|
||||
public IDictionary<string, string> Options
|
||||
{
|
||||
get { return _options; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StreamWriter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="contentType">Type of the content.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
public StreamWriter(Stream source, ILogger logger)
|
||||
public StreamWriter(Stream source, string contentType, ILogger logger)
|
||||
{
|
||||
if (string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
throw new ArgumentNullException("contentType");
|
||||
}
|
||||
|
||||
SourceStream = source;
|
||||
Logger = logger;
|
||||
|
||||
Options["Content-Type"] = contentType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user