diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index 422b94af..83a9d22e 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -57,7 +57,6 @@ epubcheck="true" recompose="true" feeds="true" bulkDownloads="true" -coverArtDatabase="false" if [ $# -eq 0 ]; then usage @@ -388,14 +387,16 @@ do mv "${imgWorkDir}/${urlSafeIdentifier}"*.{jpg,avif} "${webRoot}/images/covers/" fi - if [ "${coverArtDatabase}" = "true" ]; then - if [ "${verbose}" = "true" ]; then - printf "Updating/inserting cover in the cover art database ... " - fi + verboseDbFlag="" + if [ "${verbose}" = "true" ]; then + verboseDbFlag="--verbose" + printf "Updating/inserting ebook in database ... " + fi - if [ "${verbose}" = "true" ]; then - printf "Done.\n" - fi + "${scriptsDir}"/update-ebook-database ${verboseDbFlag} --ebookWwwFilesystemPath "${webDir}" + + if [ "${verbose}" = "true" ]; then + printf "Done.\n" fi # Delete the now-empty work dir (empty except for .git) diff --git a/scripts/update-ebook-database b/scripts/update-ebook-database new file mode 100755 index 00000000..d4051762 --- /dev/null +++ b/scripts/update-ebook-database @@ -0,0 +1,31 @@ +#!/usr/bin/php +\n"); + exit(1); +} + +if($verbose){ + print("ebookWwwFilesystemPath: $ebookWwwFilesystemPath\n"); +} + +$ebook = new Ebook($ebookWwwFilesystemPath); + +if($verbose){ + print("Title: $ebook->Title\n"); + print("Identifier: $ebook->Identifier\n"); +} + +$ebook->CreateOrUpdate();