mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 18:11:52 -04:00
Rename Created
and Updated
in PHP code to EbookCreated
and EbookUpdated
to match the schema
This commit is contained in:
parent
ac7db8d375
commit
f605a4df60
6 changed files with 19 additions and 19 deletions
|
@ -105,8 +105,8 @@ function CreateZip(string $filePath, array $ebooks, string $type, string $webRoo
|
|||
|
||||
// Iterate over all ebooks and arrange them by publication month
|
||||
foreach(Library::GetEbooksFromFilesystem($webRoot) as $ebook){
|
||||
$timestamp = $ebook->Created->format('Y-m');
|
||||
$updatedTimestamp = $ebook->Updated->getTimestamp();
|
||||
$timestamp = $ebook->EbookCreated->format('Y-m');
|
||||
$updatedTimestamp = $ebook->EbookUpdated->getTimestamp();
|
||||
|
||||
// Add to the 'ebooks by month' list
|
||||
if(!isset($ebooksByGroup['months'][$timestamp])){
|
||||
|
|
|
@ -10,7 +10,7 @@ use function Safe\mkdir;
|
|||
use function Safe\preg_replace;
|
||||
|
||||
function SortByUpdatedDesc(Ebook $a, Ebook $b): int{
|
||||
return $b->Updated <=> $a->Updated;
|
||||
return $b->EbookUpdated <=> $a->EbookUpdated;
|
||||
}
|
||||
|
||||
function SaveFeed(Feed $feed, bool $force, ?string $label = null, ?string $labelSort = null, DateTimeImmutable $now = null): void{
|
||||
|
@ -111,7 +111,7 @@ foreach(Library::GetEbooksFromFilesystem($webRoot) as $ebook){
|
|||
}
|
||||
|
||||
usort($allEbooks, 'SortByUpdatedDesc');
|
||||
usort($newestEbooks, function($a, $b){ return $b->Created <=> $a->Created; });
|
||||
usort($newestEbooks, function($a, $b){ return $b->EbookCreated <=> $a->EbookCreated; });
|
||||
$newestEbooks = array_slice($newestEbooks, 0, $ebooksPerNewestEbooksFeed);
|
||||
|
||||
// Create OPDS feeds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue