summaryrefslogtreecommitdiff
path: root/odin/strm
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-09-11 12:23:39 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-09-11 12:23:39 +0200
commit9abeefdf036271f32d9745068cfccf74c7c66e80 (patch)
tree766ee066a22dab6a808cb563842e876baae0a938 /odin/strm
parent5c2f746dffadc980b80ae69ffe090b777729d925 (diff)
downloadnixos-9abeefdf036271f32d9745068cfccf74c7c66e80.tar
nixos-9abeefdf036271f32d9745068cfccf74c7c66e80.tar.gz
nixos-9abeefdf036271f32d9745068cfccf74c7c66e80.tar.bz2
nixos-9abeefdf036271f32d9745068cfccf74c7c66e80.tar.xz
nixos-9abeefdf036271f32d9745068cfccf74c7c66e80.zip
move tmpfile into place
Diffstat (limited to 'odin/strm')
-rw-r--r--odin/strm/send_kitty8
1 files changed, 6 insertions, 2 deletions
diff --git a/odin/strm/send_kitty b/odin/strm/send_kitty
index 2b3e017b..e4139885 100644
--- a/odin/strm/send_kitty
+++ b/odin/strm/send_kitty
@@ -10,9 +10,11 @@ concatDir=${wDir}/concat
10lastFile=${concatDir}/latest.mkv 10lastFile=${concatDir}/latest.mkv
11 11
12fList="" 12fList=""
13tmpFile=""
13 14
14function cleanup() { 15function cleanup() {
15 [[ -n "${fList}" ]] && rm -v ${fList} 16 [[ -n "${fList}" ]] && rm -fv ${fList}
17 [[ -n "${tmpFile}" ]] && rm -fv ${tmpFile}
16} 18}
17 19
18trap cleanup EXIT 20trap cleanup EXIT
@@ -37,7 +39,9 @@ if [[ $(wc -l ${fList} | cut -d ' ' -f 1) -eq 0 ]]; then
37fi 39fi
38 40
39newFile="${concatDir}/hlidskjalf.$(date +'%Y-%m-%d-%H-%M-%S').mkv" 41newFile="${concatDir}/hlidskjalf.$(date +'%Y-%m-%d-%H-%M-%S').mkv"
42tmpFile=$(mktemp --tmpdir ${concatDir} "${newfile:h}/.${newFile:t:r}.XXXXXX.mkv")
40 43
41ffmpeg -safe 0 -f concat -i =(awk $'{ print "file \'"$0"\'" }' ${fList}) -c:v libx264 -r 30 -crf 27 -preset veryfast -vf 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2' -metadata "description=$(xargs -a ${fList} -- basename -s ".mkv")" ${newFile} 44ffmpeg -safe 0 -f concat -i =(awk $'{ print "file \'"$0"\'" }' ${fList}) -c:v libx264 -r 30 -crf 27 -preset veryfast -vf 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2' -metadata "description=$(xargs -a ${fList} -- basename -s ".mkv")" ${tmpFile}
45mv -v ${tmpFile} ${newFile}
42queue.hel -p -r ${newFile} 46queue.hel -p -r ${newFile}
43ln -vfs $(realpath --relative-to=${lastFile:h} ${newFile}) ${lastFile} 47ln -vfs $(realpath --relative-to=${lastFile:h} ${newFile}) ${lastFile}