Add size warning when single-page download is larger than 1MB

This commit is contained in:
Alex Cabal 2023-01-13 16:29:52 -06:00
parent e0c75b8ae0
commit 04759aa17b
5 changed files with 37 additions and 9 deletions

View file

@ -281,8 +281,8 @@ catch(Exceptions\InvalidEbookException $ex){
<li property="schema:encoding" typeof="schema:mediaObject">
<meta property="schema:description" content="XHTML"/>
<meta property="schema:encodingFormat" content="application/xhtml+xml"/>
<p>
<a property="schema:contentUrl" href="<?= $ebook->TextSinglePageUrl ?>" class="page">Read on one page</a>
<p<? if($ebook->TextSinglePageSizeNumber >= 3 && $ebook->TextSinglePageSizeUnit == 'M'){ ?> class="has-size"<? } ?>>
<a property="schema:contentUrl" href="<?= $ebook->TextSinglePageUrl ?>" class="page">Read on one page</a><? if($ebook->TextSinglePageSizeNumber >= 3 && $ebook->TextSinglePageSizeUnit == 'M'){ ?><span><?= $ebook->TextSinglePageSizeNumber ?>MB</span><? } ?>
</p>
</li>
<? } ?>

View file

@ -56,7 +56,6 @@ try{
// Are we looking at a collection?
if($collection !== null){
$ebooks = Library::GetEbooksByCollection($collection);
// Get the *actual* name of the collection, in case there are accent marks (like "Arsène Lupin")
if(sizeof($ebooks) > 0){
foreach($ebooks[0]->Collections as $c){
@ -86,7 +85,6 @@ try{
$ebooks = array_slice($ebooks, ($page - 1) * $perPage, $perPage);
}
if($page > 1){
$pageTitle .= ', page ' . $page;
}