1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(pls): add recent command

This commit is contained in:
2021-11-23 20:56:03 +01:00
parent 85ab948ccd
commit 41f87bdc37

View File

@@ -2,7 +2,7 @@
let
inherit (pkgs) lib;
playlistAPI = "prism.r:8001";
playlistAPI = "https://radio.lassul.us";
sendIRC = pkgs.writers.writeDash "send-irc" ''
${pkgs.ircaids}/bin/ircsink \
@@ -51,6 +51,9 @@ pkgs.writers.writeDashBin "pls" ''
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
;;
recent)
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
;;
*)
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
| ${pkgs.miller}/bin/mlr --ijson --oxtab cat \