public void Execute(JukeClient client, CommandOutput output, string[] arguments) { if (arguments.Length < 1) { output.WriteError("Missing query argument"); return; } var response = client.Search(arguments[0]); output.WriteMessage("Found:"); foreach (var info in response) { output.WriteMessage(info); } output.WriteMessage("--------------"); }
public void Execute(JukeClient client, CommandOutput output, string[] arguments) { if (arguments.Length < 1) { output.WriteError("Missing song title param"); return; } output.WriteMessage("Enqueueing " + arguments[0]); client.Play(arguments[0]); }
public void Execute(JukeClient client, CommandOutput output, string[] arguments) { var processes = Process.GetProcessesByName("GrpcJukeServer"); if (processes.Length > 0) { output.WriteError("Service already started"); client.StreamOutput(); return; } string path = "./GrpcJukeServer"; if (arguments.Length > 0) { path = arguments[0]; } output.WriteMessage("Starting from " + path); if (!File.Exists(path)) { output.WriteError("File doesn't exist."); return; } var result = client.Startup(path, arguments.Length > 1); if (result) { output.WriteMessage("Service started"); client.StreamOutput(); } else { output.WriteError("Service NOT started"); } }
public void Execute(JukeClient client, CommandOutput output, string[] arguments) { if (arguments.Length < 1) { output.WriteError("Missing argument filename"); return; } var response = client.LoadLibrary(arguments[0]); if (response) { output.WriteMessage("Command completed."); } else { output.WriteError("Command failed"); } }
public void Execute(JukeClient client, CommandOutput output, string[] arguments) { var info = client.PlayRandom(); output.WriteMessage("Added random"); }