mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
Fix collection sorting in bulk downloads
This commit is contained in:
parent
282909ef6a
commit
c95d8c4954
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue