From 64c96436ebf29bce5a61109ae9681b462c87e7e1 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 5 Nov 2010 00:45:31 +1100 Subject: [PATCH] Make use of the new default property of CommandOption in :sortview. --HG-- extra : rebase_source : 4b616d19e9b74229c65738be500653c075ea62e8 --- melodactyl/content/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/melodactyl/content/player.js b/melodactyl/content/player.js index 51f83011..23096d06 100644 --- a/melodactyl/content/player.js +++ b/melodactyl/content/player.js @@ -574,8 +574,7 @@ const Player = Module("player", { commands.add(["sort[view]"], "Sort the current media view", function (args) { - let order = args["-order"] || "up"; - player.sortBy(args[0], order == "up"); + player.sortBy(args[0], args["-order"] == "up"); }, { argCount: "1", @@ -583,6 +582,7 @@ const Player = Module("player", { options: [ { names: ["-order", "-o"], type: CommandOption.STRING, + default: "up", description: "Specify the sorting order of the given field", validator: function (arg) /^(up|down)$/.test(arg), completer: function () [["up", "Sort in ascending order"], ["down", "Sort in descending order"]]