From ae777ec23f62ee25348c74c3893d27c849904496 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 6 Jan 2024 21:33:01 +0100 Subject: fix(hm/pkgs/scr/specific/ytcc/yts): Add default ordering mode --- hm/soispha/pkgs/scripts/specific/ytcc/yts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hm/soispha/pkgs') diff --git a/hm/soispha/pkgs/scripts/specific/ytcc/yts b/hm/soispha/pkgs/scripts/specific/ytcc/yts index d3508bba..390cc0f5 100755 --- a/hm/soispha/pkgs/scripts/specific/ytcc/yts +++ b/hm/soispha/pkgs/scripts/specific/ytcc/yts @@ -67,6 +67,7 @@ case "$1" in case "$1" in "date") set -- "--order-by" "publish_date" "desc" + oder_mode_set=true; ;; "raw") shift 1; @@ -74,6 +75,7 @@ case "$1" in [ -z "$2" ] && die "A first argument to 'order raw' requires a second" set -- "--order-by" "$1" "$2" fi + oder_mode_set=true; ;; *) die "'$1' is not a valid subcommand for 'order'; See '--help' for a list"; @@ -85,6 +87,8 @@ case "$1" in ;; esac +# Set the default ordering mode +[ -z "$oder_mode_set" ] && set -- "--order-by" "publish_date" "desc" table="$(ytcc --output json list "$@" | jq --raw-output 'map("pick \(.id) \(.title) (\(.playlists | map(.name) | join(", "))) [\(.duration | gsub("^\\s+|\\s+$";""))]") | join("\n")')" -- cgit 1.4.1