diff --git a/lib/Constants.php b/lib/Constants.php index 9d531c86..74bedaf3 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -27,6 +27,8 @@ const MANUAL_PATH = WEB_ROOT . '/manual'; const EBOOKS_DIST_PATH = WEB_ROOT . '/ebooks/'; const COVER_ART_UPLOAD_PATH = '/images/cover-uploads/'; +const EBOOKS_IDENTIFIER_PREFIX = 'url:https://standardebooks.org/ebooks/'; + const DATABASE_DEFAULT_DATABASE = 'se'; const DATABASE_DEFAULT_HOST = 'localhost'; diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index f69e4e57..6f77f9d5 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -39,14 +39,8 @@ try{ } } - // Do we have the ebook cached? - try{ - /** @var Ebook $ebook */ - $ebook = apcu_fetch('ebook-' . $wwwFilesystemPath); - } - catch(Safe\Exceptions\ApcuException){ - $ebook = Ebook::FromFilesystem($wwwFilesystemPath); - } + $identifier = EBOOKS_IDENTIFIER_PREFIX . $urlPath; + $ebook = Ebook::GetByIdentifier($identifier); // Divide our sources into transcriptions and scans foreach($ebook->Sources as $source){