Fix collection sorting in bulk downloads

This commit is contained in:
Alex Cabal 2022-07-11 11:01:15 -05:00
parent 282909ef6a
commit c95d8c4954
2 changed files with 2 additions and 2 deletions

View file

@ -14,6 +14,6 @@ class Collection{
} }
public function GetSortedName(): string{ public function GetSortedName(): string{
return preg_replace('/^(the|and|a|)\b/ius', '', $this->Name); return preg_replace('/^(the|and|a|)\s/ius', '', $this->Name);
} }
} }

View file

@ -362,7 +362,7 @@ class Library{
foreach(glob(WEB_ROOT . '/bulk-downloads/collections/*/', GLOB_NOSORT) as $dir){ foreach(glob(WEB_ROOT . '/bulk-downloads/collections/*/', GLOB_NOSORT) as $dir){
$collections[] = self::FillBulkDownloadObject($dir, 'collections', '/collections'); $collections[] = self::FillBulkDownloadObject($dir, 'collections', '/collections');
} }
usort($authors, function($a, $b) use($collator){ return $collator->compare($a->LabelSort, $b->LabelSort); }); usort($collections, function($a, $b) use($collator){ return $collator->compare($a->LabelSort, $b->LabelSort); });
apcu_store('bulk-downloads-collections', $collections, 43200); // 12 hours apcu_store('bulk-downloads-collections', $collections, 43200); // 12 hours