summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-06-04 10:56:02 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-06-04 10:56:02 +0200
commit09ba625fef9169190eb8c764a8c64ce2ed232101 (patch)
tree6708a9910445d79fb928d61e28ed5cede07cc935 /custom
parentf43b60a6fe42bab2cc8f06562b98206a5a37a88c (diff)
downloadnixos-09ba625fef9169190eb8c764a8c64ce2ed232101.tar
nixos-09ba625fef9169190eb8c764a8c64ce2ed232101.tar.gz
nixos-09ba625fef9169190eb8c764a8c64ce2ed232101.tar.bz2
nixos-09ba625fef9169190eb8c764a8c64ce2ed232101.tar.xz
nixos-09ba625fef9169190eb8c764a8c64ce2ed232101.zip
ensure nonempty summary
Diffstat (limited to 'custom')
-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