diff options
| author | crobibero <cody@robibe.ro> | 2020-09-09 12:26:18 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-09 12:26:18 -0600 |
| commit | 25ac778a79c7ff39433db2acd92788e26228879f (patch) | |
| tree | d7c84c5598aafdc2d3fd502b940339423e84ff33 | |
| parent | 612e135c8c2b349e904bc555435bfc0977ed80d0 (diff) | |
revert changes
| -rw-r--r-- | Jellyfin.Api/Controllers/SystemController.cs | 5 | ||||
| -rw-r--r-- | Jellyfin.Api/Controllers/VideoAttachmentsController.cs | 1 |
2 files changed, 4 insertions, 2 deletions
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"); } /// <summary> diff --git a/Jellyfin.Api/Controllers/VideoAttachmentsController.cs b/Jellyfin.Api/Controllers/VideoAttachmentsController.cs index 658e63955..09a1c93e6 100644 --- a/Jellyfin.Api/Controllers/VideoAttachmentsController.cs +++ b/Jellyfin.Api/Controllers/VideoAttachmentsController.cs @@ -1,6 +1,5 @@ using System; using System.ComponentModel.DataAnnotations; -using System.IO; using System.Net.Mime; using System.Threading; using System.Threading.Tasks; |
