Flesh out OPDS generation backend to be more robust and to support generic Atom feeds

This commit is contained in:
Alex Cabal 2022-06-20 21:55:34 -05:00
parent 35188195f1
commit f6df03cfca
23 changed files with 1549 additions and 267 deletions

View file

@ -121,12 +121,8 @@ if ! [ -x "${scriptsDir}"/reset-php-fpm-opcache ]; then
die "\"${scriptsDir}\"/reset-php-fpm-opcache is not an executable file."
fi
if ! [ -f "${scriptsDir}"/generate-opds ]; then
die "\"${scriptsDir}\"/generate-opds\" is not a file or could not be found."
fi
if ! [ -f "${scriptsDir}"/generate-rss ]; then
die "\"${scriptsDir}\"/generate-rss\" is not a file or could not be found."
if ! [ -f "${scriptsDir}"/generate-feeds ]; then
die "\"${scriptsDir}\"/generate-feeds\" is not a file or could not be found."
fi
mkdir -p "${webRoot}"/www/images/covers/
@ -382,7 +378,7 @@ if [ "${verbose}" = "true" ]; then
printf "Rebuilding OPDS catalog ... "
fi
"${scriptsDir}/generate-opds" --webroot "${webRoot}" --weburl "${webUrl}"
"${scriptsDir}/generate-feeds" --webroot "${webRoot}" --weburl "${webUrl}"
sudo chown --recursive se:committers "${webRoot}/www/opds/"*
sudo chmod --recursive 664 "${webRoot}/www/opds/"*.xml
@ -400,13 +396,6 @@ if [ "${verbose}" = "true" ]; then
printf "Rebuilding new releases RSS feed ... "
fi
output=$("${scriptsDir}/generate-rss" --webroot "${webRoot}" --weburl "${webUrl}")
# Check the return code; if the script failed (for example invalid XML in content.opf), don't overwrite the existing feed with a blank file
if [ $? = 0 ]; then
echo "${output}" > "${webRoot}/www/rss/new-releases.xml"
fi
if [ "${verbose}" = "true" ]; then
printf "Done.\n"
fi