mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
adjusted the continuing anime filter
This commit is contained in:
parent
cb043f49e8
commit
ec0af72a19
@ -144,9 +144,19 @@ final class DefaultAnimeRepository extends DatabaseRepository implements AnimeRe
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
if ($includeContinuingItems) {
|
if ($includeContinuingItems) {
|
||||||
// this condition will include "continuing" items from previous seasons
|
// these conditions will include "continuing" items from previous seasons
|
||||||
|
// We want to include those which are currently airing, and their aired.to is unknown, and their start
|
||||||
|
// date is before when the current season began.
|
||||||
$finalFilter['$or'][] = [
|
$finalFilter['$or'][] = [
|
||||||
'aired.from' => ['$lte' => $from->toAtomString()],
|
'aired.from' => ['$lte' => $from->toAtomString()],
|
||||||
|
'aired.to' => null,
|
||||||
|
'airing' => true
|
||||||
|
];
|
||||||
|
// We want to include those which are currently airing, and their aired.to is past the date of the
|
||||||
|
// current season start.
|
||||||
|
$finalFilter['$or'][] = [
|
||||||
|
'aired.from' => ['$lte' => $from->toAtomString()],
|
||||||
|
'aired.to' => ['$gte' => $from->toAtomString()],
|
||||||
'airing' => true
|
'airing' => true
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user