diff options
Diffstat (limited to '')
-rwxr-xr-x | hm/soispha/pkgs/scripts/specific/ytcc/yts | 4 |
1 files changed, 4 insertions, 0 deletions
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")')" |