#!/bin/bash
# show processing times of specified pass from all recordings in $VIDEO
# parameter $1 pass
# parameter $2 video directory (default: "/media/Video/VDR")

if [ -n "$1" ]; then
    PASS=$1
else
    echo "usage: markad_gettime_pass <pass> [<video directory>]"
    exit
fi

if [ -n "$2" ]; then
    VIDEO=$2
else
    VIDEO="/media/Video/VDR"
fi

echo "use video directory: $VIDEO"
echo "show pass:           $PASS"

grep -r "pass $1" --include "markad.log" $VIDEO | awk -F  " " '{printf "%3ds %s\n", $12, $1}' | sort --numeric-sort -k1,1 -k2,2
