From c95d8c49544d83a144ec8056de9027c09afda858 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 11 Jul 2022 11:01:15 -0500 Subject: [PATCH] Fix collection sorting in bulk downloads --- lib/Collection.php | 2 +- lib/Library.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Collection.php b/lib/Collection.php index 479da80a..e2c455a1 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -14,6 +14,6 @@ class Collection{ } public function GetSortedName(): string{ - return preg_replace('/^(the|and|a|)\b/ius', '', $this->Name); + return preg_replace('/^(the|and|a|)\s/ius', '', $this->Name); } } diff --git a/lib/Library.php b/lib/Library.php index 737cc2cc..254f8ebc 100644 --- a/lib/Library.php +++ b/lib/Library.php @@ -362,7 +362,7 @@ class Library{ foreach(glob(WEB_ROOT . '/bulk-downloads/collections/*/', GLOB_NOSORT) as $dir){ $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