support copying support files to git

This commit is contained in:
2025-11-07 17:36:38 +01:00
parent 20f1951321
commit 0f7994efc4

View File

@@ -9,15 +9,16 @@
# Variables # Variables
debug="1" debug="1"
force_overwrite=true # Sets the behavour when files exist or not force_overwrite=true # Sets the behavour when files exist or not
processing_dir="$HOME/tmp/hpr/processing" # The directory where the files will be copied to for processing git_dir="$HOME/sourcecode/hpr/hpr_website" # The git directory for extra assets
theme="${processing_dir}/theme.flac" # The hpr theme processing_dir="$HOME/tmp/hpr/processing" # The directory where the files will be copied to for processing
silence="${processing_dir}/silence.flac" # A segment of silence to offset the tts in the intro theme="${processing_dir}/theme.flac" # The hpr theme
outro_flac="${processing_dir}/outro.flac" # The outro edited media silence="${processing_dir}/silence.flac" # A segment of silence to offset the tts in the intro
outro_srt="${processing_dir}/outro.srt" # The outro subtitle file outro_flac="${processing_dir}/outro.flac" # The outro edited media
intro_srt="${processing_dir}/intro.srt" # The intro subtitle template file outro_srt="${processing_dir}/outro.srt" # The outro subtitle file
intro_srt="${processing_dir}/intro.srt" # The intro subtitle template file
piper_bin="/opt/bin/piper/piper/piper" # The location of the text to speech engine piper_bin="/opt/bin/piper/piper/piper" # The location of the text to speech engine
piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/lessac/medium/en_US-lessac-medium.onnx" piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/lessac/medium/en_US-lessac-medium.onnx"
working_dir_bypass="false" working_dir_bypass="false"
@@ -381,6 +382,16 @@ function check_variable_is_correct() {
echo_error "The \"genre\" variable is missing." echo_error "The \"genre\" variable is missing."
fi fi
;; ;;
git_dir)
if [[ -z "${git_dir}" || "${git_dir}" == "null" ]]
then
echo_error "The \"git_dir\" variable is missing."
fi
if [[ ! -d "${git_dir}" || ! -d "${git_dir}/.git" ]]
then
echo_error "The \"git_dir\" variable is missing or file \"${git_dir}\" does not exist."
fi
;;
HOME) HOME)
if [[ ! -d "${HOME}" || -z "${HOME}" ]] if [[ ! -d "${HOME}" || -z "${HOME}" ]]
then then
@@ -2054,6 +2065,32 @@ function copy_files_to_hpr_server() {
} }
#################################################
# Copy the images to the hpr server
function copy_files_to_git() {
echo_debug "Copying the files to the hpr server. copy_files_to_git()"
check_variable_is_correct working_dir ep_num git_dir files_json
if [ ! -d "${git_dir}/www/eps/hpr${ep_num}/" ]
then
mkdir -v "${git_dir}/www/eps/hpr${ep_num}/"
fi
for this_file in $( jq --raw-output ".hpr${ep_num} | keys | @tsv" "${files_json}" )
do
skip_file="$( echo "$this_file" | grep --count --perl-regexp "hpr${ep_num}.flac|hpr${ep_num}.mp3|hpr${ep_num}.ogg|hpr${ep_num}.opus|hpr${ep_num}.spx|hpr${ep_num}.srt|hpr${ep_num}.txt|hpr${ep_num}.wav" )"
if [ "${skip_file}" -eq "1" ]
then
continue
fi
cp -v "${working_dir}/$this_file" "${git_dir}/www/eps/hpr${ep_num}/"
done
}
################################################# #################################################
# Send the derived files to the server borg to be sent to borg # Send the derived files to the server borg to be sent to borg
@@ -2377,6 +2414,8 @@ check_variable_is_correct working_dir ep_num shownotes_edited
copy_files_to_hpr_server copy_files_to_hpr_server
copy_files_to_git
copy_derived_files_to_borg copy_derived_files_to_borg
create_item_on_the_internet_archive create_item_on_the_internet_archive