aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/FileWriter.cs
diff options
context:
space:
mode:
authorstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
committerstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
commit48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch)
tree8dae77a31670a888d733484cb17dd4077d5444e8 /Emby.Server.Implementations/HttpServer/FileWriter.cs
parentc32d8656382a0eacb301692e0084377fc433ae9b (diff)
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/FileWriter.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/FileWriter.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/FileWriter.cs b/Emby.Server.Implementations/HttpServer/FileWriter.cs
index aa679e1b9..353ba5282 100644
--- a/Emby.Server.Implementations/HttpServer/FileWriter.cs
+++ b/Emby.Server.Implementations/HttpServer/FileWriter.cs
@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Services;
+using System.Linq;
namespace Emby.Server.Implementations.HttpServer
{
@@ -147,6 +148,13 @@ namespace Emby.Server.Implementations.HttpServer
}
}
+ private string[] SkipLogExtensions = new string[]
+ {
+ ".js",
+ ".html",
+ ".css"
+ };
+
public async Task WriteToAsync(IResponse response, CancellationToken cancellationToken)
{
try
@@ -157,17 +165,24 @@ namespace Emby.Server.Implementations.HttpServer
return;
}
+ var path = Path;
+
if (string.IsNullOrWhiteSpace(RangeHeader) || (RangeStart <= 0 && RangeEnd >= TotalContentLength - 1))
{
- Logger.Info("Transmit file {0}", Path);
+ var extension = System.IO.Path.GetExtension(path);
+
+ if (extension == null || !SkipLogExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
+ {
+ Logger.Debug("Transmit file {0}", path);
+ }
//var count = FileShare == FileShareMode.ReadWrite ? TotalContentLength : 0;
- await response.TransmitFile(Path, 0, 0, FileShare, cancellationToken).ConfigureAwait(false);
+ await response.TransmitFile(path, 0, 0, FileShare, cancellationToken).ConfigureAwait(false);
return;
}
- await response.TransmitFile(Path, RangeStart, RangeLength, FileShare, cancellationToken).ConfigureAwait(false);
+ await response.TransmitFile(path, RangeStart, RangeLength, FileShare, cancellationToken).ConfigureAwait(false);
}
finally
{