~smlavine/scripts

d01b5e637b661425887f3a353ee4b69365c796ec — Sebastian LaVine 6 months ago ee393d6
musicsum: Remove early exit

Now, if no files are provided, "0h0m0s" wil be printed.
1 files changed, 0 insertions(+), 2 deletions(-)

M src/musicsum
M src/musicsum => src/musicsum +0 -2
@@ 6,8 6,6 @@
# Description: Sums the length of given audio files.
# Arguments:   Audio files to sum the duration of

[ -z "$*" ] && exit 1

mediainfo "$@" | \
	grep Duration | tr -s ' ' | cut -d' ' -f'3,5' | \
	awk 'NR % 2 != 1 { sum += $2; sum += $1*60 }