From aae14715f5dc8ce231a32ed914ea89f8bc64f323 Mon Sep 17 00:00:00 2001 From: Ken Fallon Date: Fri, 27 Dec 2024 10:41:13 +0100 Subject: [PATCH] Added CC-0 to header --- workflow/audio2image.bash | 4 +++- workflow/check_assets.bash | 6 ++--- workflow/duration.bash | 4 +++- workflow/hpr-assets.bash | 4 +++- workflow/hpr-publish.bash | 45 ++++++++++++++++++++++++++++++++++++++ workflow/hprtranscode.bash | 3 ++- workflow/postshow.bash | 3 --- 7 files changed, 59 insertions(+), 10 deletions(-) create mode 100755 workflow/hpr-publish.bash diff --git a/workflow/audio2image.bash b/workflow/audio2image.bash index a5e20d5..fe25e56 100755 --- a/workflow/audio2image.bash +++ b/workflow/audio2image.bash @@ -1,4 +1,6 @@ -#!/bin/bash - +#!/usr/bin/env bash +# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +#============================================================ # # Copied from a 'history' file on archive.org and turned into a script diff --git a/workflow/check_assets.bash b/workflow/check_assets.bash index a1d3c9e..9c147f1 100755 --- a/workflow/check_assets.bash +++ b/workflow/check_assets.bash @@ -1,6 +1,6 @@ -#!/bin/bash - -# CC-0 Ken Fallon +#!/usr/bin/env bash +# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +#============================================================ assets_db="assets_202410181601.csv" total="$( wc -l assets_202410181601.csv | awk '{print $1}' )" diff --git a/workflow/duration.bash b/workflow/duration.bash index 5448931..91c9580 100755 --- a/workflow/duration.bash +++ b/workflow/duration.bash @@ -1,5 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +#============================================================ + find ${HOME}/processing/ -type f | egrep -v '/sponsor-anhonesthost.com-hpr15.flac|/outro.flac|/intro.flac|/sponsor-archive.org.flac' | while read mediafile do duration=$( mediainfo --full --Output=XML "${mediafile}" | xmlstarlet sel -T -t -m "_:MediaInfo/_:media/_:track[@type='Audio']/_:Duration[1]" -v "." -n - | awk -F '.' '{print $1}' ) diff --git a/workflow/hpr-assets.bash b/workflow/hpr-assets.bash index f1b2bdf..5854256 100755 --- a/workflow/hpr-assets.bash +++ b/workflow/hpr-assets.bash @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash +# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +#============================================================ file_dir="/var/IA/uploads" diff --git a/workflow/hpr-publish.bash b/workflow/hpr-publish.bash new file mode 100755 index 0000000..ef70243 --- /dev/null +++ b/workflow/hpr-publish.bash @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +#============================================================ + +git_dir="$HOME/tmp/hpr/hpr_generator/sourcecode" +if [ ! -d "${git_dir}/.git" ] +then + #git clone gitea@repo.anhonesthost.net:rho_n/hpr_generator.git "${git_dir}" + git clone gitea@repo.anhonesthost.net:HPR/hpr_generator.git "${git_dir}" +fi + +cd "${git_dir}" + +git pull + +ssh hpr -t "ls -al /home/hpr/www/hpr.sql;md5sum /home/hpr/www/hpr.sql" +ssh hpr -t "/home/hpr/bin/hpr_db_backup.bash" +ssh hpr -t "ls -al /home/hpr/www/hpr.sql;md5sum /home/hpr/www/hpr.sql" + +./utils/update-hpr-db.sh +if [ $? -ne 0 ] +then + echo 'Terminating...' >&2 + exit 1 +fi + +./site-generator --all --verbose +if [ $? -ne 0 ] +then + echo 'Terminating...' >&2 + exit 1 +fi + +rsync -av --partial --progress "${git_dir}/public_html/" hpr:/home/hpr/public_html/ +rsync -av --partial --progress "${git_dir}/public_html/" hobbypublicradio.org:hobbypublicradio.org/ + +cd $HOME/sourcecode/hpr/hpr_hub/ +git pull +cd $HOME/sourcecode/hpr/hpr_hub/sql +split --hex-suffixes --lines=1000 --additional-suffix=.sql hpr.sql hpr-db-part- +cd $HOME/sourcecode/hpr/hpr_hub/ +git add $HOME/sourcecode/hpr/hpr_hub/sql/hpr*sql +git commit -m "$(\date -u +%Y-%m-%d_%H-%M-%SZ_%A ) database changed" +git push +#xdg-open https://hackerpublicradio.org/ diff --git a/workflow/hprtranscode.bash b/workflow/hprtranscode.bash index 220912a..9455020 100755 --- a/workflow/hprtranscode.bash +++ b/workflow/hprtranscode.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash -# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ +# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ #============================================================ + PATH=$PATH:$HOME/sourcecode/hpr/hpr_hub/bin/ source $HOME/tmp/pip3.9/bin/activate # https://hub.tcno.co/ai/whisper/install/ diff --git a/workflow/postshow.bash b/workflow/postshow.bash index 8909774..6a6b65c 100755 --- a/workflow/postshow.bash +++ b/workflow/postshow.bash @@ -255,12 +255,9 @@ fi # Post show to HPR # -post_show="${processing_dir}/${dest_dir}/post_show.txt" post_show_json="${processing_dir}/${dest_dir}/post_show.json" post_show_response="${processing_dir}/${dest_dir}/post_show_response.txt" -echo "key=${key}&ep_num=${ep_num}&ep_date=${ep_date}&email=${email}&title=${title}&duration=${duration}&summary=${summary}&series_id=${series_id}&series_name=${series_name}&explicit=${explicit}&episode_license=${episode_license}&tags=${tags}&hostid=${hostid}&host_name=${host_name}&host_license=${host_license}&host_profile=${host_profile}¬es=${notes}" > ${post_show} - echo "Sending:" cat "${post_show}" echo "key=${key}