Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
        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]);
        }
Exemplo n.º 3
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");
            }
        }
Exemplo n.º 4
0
        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("--------------");
        }