From 94e777bbd4c15fda8154e3b89067e0f799551379 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 25 Jun 2023 22:07:32 +0400 Subject: [PATCH] Added duration cmd to radioctl. --- tools/radioctl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/radioctl b/tools/radioctl index cc83079..8ad2b35 100644 --- a/tools/radioctl +++ b/tools/radioctl @@ -30,11 +30,16 @@ case $1 in done break ;; + d | duration) + find $radio_dir/music -iname '*.ogg' -exec ffprobe -i "{}" \ + -show_entries format=duration -v quiet -of csv="p=0" \; | + paste -s -d+ - | bc *) echo "f|ilelist - to generate a filelist.html" echo "p|laylist - to generate a playlist 'all'" echo "s|huffle - to shuffle a playlist and store as all-rand" echo "c|onvert DIR - convert all files in DIR to ogg" + echo "d|uration - get total songs' duration" exit ;; esac \ No newline at end of file