Improve how collections are organized and internally and printed to HTML

This commit is contained in:
Alex Cabal 2020-05-22 16:22:46 -05:00
parent c8cacc4ace
commit aed7db7fc1
4 changed files with 23 additions and 15 deletions

View file

@ -163,16 +163,16 @@ class Library{
// Create the collections cache
foreach($ebook->Collections as $collection){
$lcCollection = strtolower(Formatter::RemoveDiacritics($collection->Name));
if(!array_key_exists($lcCollection, $collections)){
$collections[$lcCollection] = [];
$urlSafeCollection = Formatter::MakeUrlSafe($collection->Name);
if(!array_key_exists($urlSafeCollection, $collections)){
$collections[$urlSafeCollection] = [];
}
if($collection->SequenceNumber !== null){
$collections[$lcCollection][$collection->SequenceNumber] = $ebook;
$collections[$urlSafeCollection][$collection->SequenceNumber] = $ebook;
}
else{
$collections[$lcCollection][] = $ebook;
$collections[$urlSafeCollection][] = $ebook;
}
}