mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-09 07:46:26 +02:00
Add host index support to list files remote command
This commit is contained in:
@@ -90,6 +90,19 @@ public class FileCommands
|
|||||||
|
|
||||||
public void ListFilesRemote(string args)
|
public void ListFilesRemote(string args)
|
||||||
{
|
{
|
||||||
|
if (int.TryParse(args, out int index))
|
||||||
|
{
|
||||||
|
List<NetworkSocket> hosts = hostsManager.ToList();
|
||||||
|
|
||||||
|
if (index < 1 || index > hosts.Count)
|
||||||
|
{
|
||||||
|
ApiManager.SendNotificationMessageNewLine("Invalid index!", NotificationMessageType.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
args = $"{hosts[index - 1].IPAddress}:{hosts[index - 1].Port}";
|
||||||
|
}
|
||||||
|
|
||||||
string[] parts = args.Split(":");
|
string[] parts = args.Split(":");
|
||||||
|
|
||||||
if (parts.Length != 2)
|
if (parts.Length != 2)
|
||||||
@@ -145,8 +158,6 @@ public class FileCommands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
foreach (HyperFileDto fileInfo in fileInfos)
|
foreach (HyperFileDto fileInfo in fileInfos)
|
||||||
{
|
{
|
||||||
index++;
|
index++;
|
||||||
|
|||||||
Reference in New Issue
Block a user