Merge pull request #3799 from bernarden/feature/sorting-logs-in-decreasing-order

Sorts log files in decreasing order.
This commit is contained in:
Jamie 2020-10-07 08:09:14 +01:00 committed by GitHub
commit 148ae2ee71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,8 @@ namespace Ombi.Controllers.V2
var logsFolder = Path.Combine(_hosting.ContentRootPath, "Logs"); var logsFolder = Path.Combine(_hosting.ContentRootPath, "Logs");
var files = Directory var files = Directory
.EnumerateFiles(logsFolder, "*.txt", SearchOption.TopDirectoryOnly) .EnumerateFiles(logsFolder, "*.txt", SearchOption.TopDirectoryOnly)
.Select(Path.GetFileName); .Select(Path.GetFileName)
.OrderByDescending(name => name);
return Ok(files); return Ok(files);
} }