mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
revert changes
This commit is contained in:
parent
612e135c8c
commit
25ac778a79
2 changed files with 4 additions and 2 deletions
|
@ -198,7 +198,10 @@ namespace Jellyfin.Api.Controllers
|
||||||
var file = _fileSystem.GetFiles(_appPaths.LogDirectoryPath)
|
var file = _fileSystem.GetFiles(_appPaths.LogDirectoryPath)
|
||||||
.First(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));
|
.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>
|
/// <summary>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.IO;
|
|
||||||
using System.Net.Mime;
|
using System.Net.Mime;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
Loading…
Reference in a new issue