mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-29 11:02:14 +01:00
fixed plugin assembly downloads as well as debug/release detection with nuget assemblies
This commit is contained in:
@@ -312,8 +312,6 @@ namespace MediaBrowser.Common.Kernel
|
||||
// Set these to null so that they can be lazy loaded again
|
||||
Configuration = null;
|
||||
|
||||
ReloadLogger();
|
||||
|
||||
Logger.Info("Version {0} initializing", ApplicationVersion);
|
||||
|
||||
await OnConfigurationLoaded().ConfigureAwait(false);
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
<Compile Include="Net\IWebSocket.cs" />
|
||||
<Compile Include="Net\IWebSocketServer.cs" />
|
||||
<Compile Include="Net\MimeTypes.cs" />
|
||||
<Compile Include="Net\StreamWriter.cs" />
|
||||
<Compile Include="Net\UdpMessageReceivedEventArgs.cs" />
|
||||
<Compile Include="Net\WebSocketConnectEventArgs.cs" />
|
||||
<Compile Include="Net\WebSocketConnection.cs" />
|
||||
|
||||
@@ -241,6 +241,10 @@ namespace MediaBrowser.Common.Net
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (contentType.StartsWith("application/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -257,7 +261,10 @@ namespace MediaBrowser.Common.Net
|
||||
if (!compress || string.IsNullOrEmpty(RequestContext.CompressionType))
|
||||
{
|
||||
Response.ContentType = contentType;
|
||||
return await factoryFn().ConfigureAwait(false);
|
||||
|
||||
var stream = await factoryFn().ConfigureAwait(false);
|
||||
|
||||
return new StreamWriter(stream);
|
||||
}
|
||||
|
||||
string content;
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace MediaBrowser.Common.Net
|
||||
// Misc
|
||||
if (ext.Equals(".dll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "application/x-msdownload";
|
||||
return "application/octet-stream";
|
||||
}
|
||||
|
||||
// Web
|
||||
|
||||
48
MediaBrowser.Common/Net/StreamWriter.cs
Normal file
48
MediaBrowser.Common/Net/StreamWriter.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using ServiceStack.Service;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Common.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Class StreamWriter
|
||||
/// </summary>
|
||||
public class StreamWriter : IStreamWriter
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the source stream.
|
||||
/// </summary>
|
||||
/// <value>The source stream.</value>
|
||||
public Stream SourceStream { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StreamWriter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
public StreamWriter(Stream source)
|
||||
{
|
||||
SourceStream = source;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes to.
|
||||
/// </summary>
|
||||
/// <param name="responseStream">The response stream.</param>
|
||||
public void WriteTo(Stream responseStream)
|
||||
{
|
||||
var task = WriteToAsync(responseStream);
|
||||
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes to async.
|
||||
/// </summary>
|
||||
/// <param name="responseStream">The response stream.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private Task WriteToAsync(Stream responseStream)
|
||||
{
|
||||
return SourceStream.CopyToAsync(responseStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user