Improve file list commands

This commit is contained in:
Stone_Red
2023-12-14 11:21:31 +01:00
parent ec7bca5fc8
commit f635b0d855
2 changed files with 35 additions and 4 deletions
@@ -227,7 +227,13 @@ public class ApiManager
{
SendNotificationMessageNewLine($"{recivedEventArgs.IpAddress} > Requesting file list", NotificationMessageType.Log);
await recivedEventArgs.SendResponseAsync(FilesManager.ToList().Select(f => new HyperFileDto(f)).ToList());
List<HyperFileDto> files = FilesManager
.ToList()
.Select(f => new HyperFileDto(f))
.Where(f => f.Name.Contains(recivedEventArgs.Data))
.ToList();
await recivedEventArgs.SendResponseAsync(files);
}
private void ReciveMessage(object? sender, MessageRecivedEventArgs<string> recivedEventArgs)