Make spellcheck happy
This commit is contained in:
parent
cc0e3c4d56
commit
79bda5ab72
1 changed files with 13 additions and 15 deletions
|
@ -8,7 +8,7 @@ die() {
|
||||||
error "$*"
|
error "$*"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
# shellcheck disable=SC2317
|
||||||
process_args() {
|
process_args() {
|
||||||
while :; do
|
while :; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -35,7 +35,7 @@ get_file_hash() {
|
||||||
then
|
then
|
||||||
if (( file_size > 0 ))
|
if (( file_size > 0 ))
|
||||||
then
|
then
|
||||||
if (( $file_size > 2000000 ))
|
if (( file_size > 2000000 ))
|
||||||
then
|
then
|
||||||
#calculate
|
#calculate
|
||||||
local tmp_file
|
local tmp_file
|
||||||
|
@ -56,7 +56,6 @@ get_file_hash() {
|
||||||
|
|
||||||
get_file_size() {
|
get_file_size() {
|
||||||
local file
|
local file
|
||||||
local a
|
|
||||||
file=$1
|
file=$1
|
||||||
if [ -f "$file" ]
|
if [ -f "$file" ]
|
||||||
then
|
then
|
||||||
|
@ -82,12 +81,11 @@ insert_media() {
|
||||||
sed -i -e "s#\[\[${tag}\]\]#${filename}#g" \
|
sed -i -e "s#\[\[${tag}\]\]#${filename}#g" \
|
||||||
-e "s#\[\[${tag}_filesize\]\]#${filesize}#g" \
|
-e "s#\[\[${tag}_filesize\]\]#${filesize}#g" \
|
||||||
-e "s#\[\[${tag}_filehash\]\]#${filehash}#g" \
|
-e "s#\[\[${tag}_filehash\]\]#${filehash}#g" \
|
||||||
${folder}"/montage.kdenlive" || {
|
"${folder}/montage.kdenlive" || {
|
||||||
error "sed command error on insert media!"
|
error "sed command error on insert media!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test=""
|
|
||||||
base_dir="${HOME}/medias/videos/sambab"
|
base_dir="${HOME}/medias/videos/sambab"
|
||||||
|
|
||||||
conf="$*"
|
conf="$*"
|
||||||
|
@ -104,19 +102,19 @@ friday=$(date --date='last Friday' +"%Y.%m.%d")
|
||||||
folder="${base_dir}/${friday}-${conf// /_}"
|
folder="${base_dir}/${friday}-${conf// /_}"
|
||||||
|
|
||||||
#create it
|
#create it
|
||||||
mkdir "${folder}"/{rushes,audio,titles} -p || die "folder creation failed"
|
mkdir "${folder}/"{rushes,audio,titles} -p || die "folder creation failed"
|
||||||
|
|
||||||
|
|
||||||
cp "${base_dir}/logo_amis.svg" "${folder}/titles" || die "SVG copy failed!"
|
cp "${base_dir}/logo_amis.svg" "${folder}/titles" || die "SVG copy failed!"
|
||||||
cp "${base_dir}/template.kdenlive" "${folder}/montage.kdenlive" || dir "Template copy failed!" }
|
cp "${base_dir}/template.kdenlive" "${folder}/montage.kdenlive" || die "Template copy failed!"
|
||||||
|
|
||||||
inkscape_date=$(LC_ALL=fr_FR.UTF-8 date --date='last Friday' +"%A %d %B %Y")
|
inkscape_date=$(LC_ALL=fr_FR.UTF-8 date --date='last Friday' +"%A %d %B %Y")
|
||||||
|
|
||||||
printf "Put Name on title\n"
|
printf "Put Name on title\n"
|
||||||
sed -i "s/\[\[conf\]\]/${conf//_/ }/g" ${folder}/titles/logo_amis.svg || die "Change text on credits screen failed!"
|
sed -i "s/\[\[conf\]\]/${conf//_/ }/g" "${folder}/titles/logo_amis.svg" || die "Change text on credits screen failed!"
|
||||||
|
|
||||||
printf "Put date on title\n"
|
printf "Put date on title\n"
|
||||||
sed -i "s/\[\[date\]\]/${inkscape_date}/g" ${folder}/titles/logo_amis.svg || die "Change date failed!"
|
sed -i "s/\[\[date\]\]/${inkscape_date}/g" "${folder}/titles/logo_amis.svg" || die "Change date failed!"
|
||||||
|
|
||||||
printf "Export SVG title \n"
|
printf "Export SVG title \n"
|
||||||
inkscape --export-type="png" "${folder}/titles/logo_amis.svg" || die "Export failed"
|
inkscape --export-type="png" "${folder}/titles/logo_amis.svg" || die "Export failed"
|
||||||
|
@ -125,11 +123,11 @@ printf "Importing PNG File in %s/montage.kdenlive \n" "$folder"
|
||||||
insert_media "$folder/titles/logo_amis.png" "logo"
|
insert_media "$folder/titles/logo_amis.png" "logo"
|
||||||
|
|
||||||
echo "Mount USBkey with Label $key_label"
|
echo "Mount USBkey with Label $key_label"
|
||||||
usb_key="/dev/$(lsblk -o KNAME,LABEL | grep ${key_label} | awk '{print $1}')"
|
usb_key="/dev/$(lsblk -o KNAME,LABEL | grep "${key_label}" | awk '{print $1}')"
|
||||||
[[ ! $usb_key = "/dev/" ]] || die "Can't getting device name, is USB key plugged? $usb_key"
|
[[ ! $usb_key = "/dev/" ]] || die "Can't getting device name, is USB key plugged? $usb_key"
|
||||||
|
|
||||||
|
|
||||||
disk="$(udisksctl mount -b ${usb_key} | awk '{print $4}')"
|
disk="$(udisksctl mount -b "${usb_key}" | awk '{print $4}')"
|
||||||
sleep 1
|
sleep 1
|
||||||
[[ -n $disk ]] || die " -> Error mounting device $usb_key"
|
[[ -n $disk ]] || die " -> Error mounting device $usb_key"
|
||||||
|
|
||||||
|
@ -137,8 +135,8 @@ sleep 1
|
||||||
printf "Change root folder in montage.kdenlive to %s\n" "$folder"
|
printf "Change root folder in montage.kdenlive to %s\n" "$folder"
|
||||||
sed -i -e "s#\[\[root_folder\]\]#${folder}#g" "${folder}/montage.kdenlive"
|
sed -i -e "s#\[\[root_folder\]\]#${folder}#g" "${folder}/montage.kdenlive"
|
||||||
|
|
||||||
printf "Copying Audio File\n" "$folder"
|
printf "Copying Audio File: %s\n" "$folder"
|
||||||
if mv "${disk}/RECORD/EXREC/*.MP3" "${folder}/audio/audio.mp3";
|
if mv "${disk}/RECORD/EXREC/"*.MP3 "${folder}/audio/audio.mp3";
|
||||||
then
|
then
|
||||||
# import audio file
|
# import audio file
|
||||||
printf "Importing Audio File in %s/montage.kdenlive \n" "$folder"
|
printf "Importing Audio File in %s/montage.kdenlive \n" "$folder"
|
||||||
|
@ -148,12 +146,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Copying Video File\n"
|
printf "Copying Video File\n"
|
||||||
if mv "${disk}/$(date --date='last Friday' +'%Y-%m-%d')\ *.mkv" "${folder}/rushes/obs.mkv";
|
if mv "${disk}/$(date --date='last Friday' +'%Y-%m-%d')"\ *.mkv "${folder}/rushes/obs.mkv";
|
||||||
then
|
then
|
||||||
insert_media "${folder}/rushes/obs.mkv" video
|
insert_media "${folder}/rushes/obs.mkv" video
|
||||||
else
|
else
|
||||||
error "Moving video file failed!"
|
error "Moving video file failed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
udisksctl unmount -b ${usb_key}
|
udisksctl unmount -b "${usb_key}"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue