Skip to content

Commit

Permalink
Exclude cover image from feed
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Dec 14, 2024
1 parent f8bb5b9 commit 80a2f1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/php/de/thekid/dialog/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function authenticate(string $user, Secret $secret): ?Document {
/** Returns newest entries */
public function newest(int $limit): array<Document> {
$cursor= $this->database->collection('entries')->aggregate([
['$match' => ['is.journey' => ['$ne' => true], 'published' => ['$lt' => Date::now()]]],
['$match' => ['is.content' => ['$eq' => true], 'published' => ['$lt' => Date::now()]]],
['$unset' => '_searchable'],
['$sort' => ['date' => -1]],
['$limit' => $limit],
Expand All @@ -53,7 +53,7 @@ public function journeys(): array<Document> {
/** Returns paginated entries */
public function entries(Pagination $pagination, int $page): array<Document> {
$cursor= $this->database->collection('entries')->aggregate([
['$match' => ['is.journey' => ['$ne' => true], 'published' => ['$lt' => Date::now()]]],
['$match' => ['is.content' => ['$eq' => true], 'published' => ['$lt' => Date::now()]]],
['$unset' => '_searchable'],
['$sort' => ['date' => -1]],
['$skip' => $pagination->skip($page)],
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/de/thekid/dialog/import/Sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function items(Folder $origin): iterable {
'keywords' => $d->meta['keywords'] ?? [],
'locations' => isset($d->meta['location']) ? [$d->meta['location']] : $d->meta['locations'],
'content' => $d->content,
'is' => ['content' => true],
'is' => ['cover' => true],
];
}
};
Expand Down

0 comments on commit 80a2f1b

Please sign in to comment.