1(import [protocol [commands]]2 [protocol.util :as util])3(require [hy.contrib.walk [let]])45;; TODO: Implement random and consume67(with-decorator (commands.add "single")8 (defn single [ctx args]9 (let [arg (first args)]10 (if (= arg "oneshot")11 (raise (NotImplementedError "oneshot mode not supported")))12 (with (playlist ctx.playback)13 (assoc (. playlist mode) :single14 (cond15 [(= arg "1") True]16 [(= arg "0") False]17 [True (raise (ValueError "unexpected repeat argument"))]))))))1819(with-decorator (commands.add "repeat")20 (defn repeat [ctx args]21 (with (playlist ctx.playback)22 (assoc (. playlist mode) :repeat (first args))23 None)))