summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/recv-media.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/custom/recv-media.sh b/custom/recv-media.sh
index 03c37e06..2f291dcc 100644
--- a/custom/recv-media.sh
+++ b/custom/recv-media.sh
@@ -46,11 +46,16 @@ fi
46 46
47if @donotify@; then 47if @donotify@; then
48 ( 48 (
49 summary=""
50
49 if @showtitle@; then 51 if @showtitle@; then
50 summary=$(@ffmpeg@/bin/ffmpeg -i "${target}" -f ffmetadata pipe:1 2>/dev/null | sed -r '/\[CHAPTER\]/q; /^title=/!d; s/^title=//') 52 summary=$(@ffmpeg@/bin/ffmpeg -i "${target}" -f ffmetadata pipe:1 2>/dev/null | sed -r '/\[CHAPTER\]/q; /^title=/!d; s/^title=//; s/(^\s*|\s*$)//g')
51 else 53 fi
54
55 if [[ -z "${summary}" ]]; then
52 summary=${target:t} 56 summary=${target:t}
53 fi 57 fi
58
54 printf "%s\n%s\n" "${summary}" "" | @notify@ -a recv-media || true 59 printf "%s\n%s\n" "${summary}" "" | @notify@ -a recv-media || true
55 ) || true 60 ) || true
56fi 61fi