From 25ac778a79c7ff39433db2acd92788e26228879f Mon Sep 17 00:00:00 2001 From: crobibero Date: Wed, 9 Sep 2020 12:26:18 -0600 Subject: revert changes --- Jellyfin.Api/Controllers/SystemController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Jellyfin.Api/Controllers/SystemController.cs') diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs index 256f39d0c..e878e8f36 100644 --- a/Jellyfin.Api/Controllers/SystemController.cs +++ b/Jellyfin.Api/Controllers/SystemController.cs @@ -198,7 +198,10 @@ namespace Jellyfin.Api.Controllers var file = _fileSystem.GetFiles(_appPaths.LogDirectoryPath) .First(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase)); - return File(file.FullName, MediaTypeNames.Text.Plain); + // For older files, assume fully static + var fileShare = file.LastWriteTimeUtc < DateTime.UtcNow.AddHours(-1) ? FileShare.Read : FileShare.ReadWrite; + FileStream stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, fileShare); + return File(stream, "text/plain"); } /// -- cgit v1.2.3