mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
Merge branch 'master' into automated-tests
This commit is contained in:
commit
bcd8e40661
@ -11,12 +11,15 @@ use Spatie\Enum\Laravel\Enum;
|
||||
* @method static self special()
|
||||
* @method static self ona()
|
||||
* @method static self music()
|
||||
* @method static self cm()
|
||||
* @method static self pv()
|
||||
* @method static self tv_special()
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="anime_search_query_type",
|
||||
* description="Available Anime types",
|
||||
* type="string",
|
||||
* enum={"tv","movie","ova","special","ona","music","cm","pv","tv-special"}
|
||||
* enum={"tv","movie","ova","special","ona","music","cm","pv","tv_special"}
|
||||
* )
|
||||
*/
|
||||
final class AnimeTypeEnum extends Enum
|
||||
@ -32,7 +35,7 @@ final class AnimeTypeEnum extends Enum
|
||||
'music' => 'Music',
|
||||
'cm' => 'CM',
|
||||
'pv' => 'PV',
|
||||
'tv-special' => 'TV Special'
|
||||
'tv_special' => 'TV Special'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ use Spatie\Enum\Laravel\Enum;
|
||||
* schema="manga_search_query_type",
|
||||
* description="Available Manga types",
|
||||
* type="string",
|
||||
* enum={"manga","novel", "lightnovel", "oneshot","doujin","manhwa","manhua","one-shot"}
|
||||
* enum={"manga","novel", "lightnovel", "oneshot","doujin","manhwa","manhua"}
|
||||
* )
|
||||
*/
|
||||
final class MangaTypeEnum extends Enum
|
||||
@ -31,8 +31,7 @@ final class MangaTypeEnum extends Enum
|
||||
'oneshot' => 'One-shot',
|
||||
'doujin' => 'Doujinshi',
|
||||
'manhwa' => 'Manhwa',
|
||||
'manhua' => 'Manhua',
|
||||
'one-shot' => 'One-shot'
|
||||
'manhua' => 'Manhua'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class ScheduleController extends Controller
|
||||
* in="query",
|
||||
* required=false,
|
||||
* description="Filter by day",
|
||||
* @OA\Schema(type="string",enum={"monday", "tuesday", "wednesday", "thursday", "friday", "unknown", "other"})
|
||||
* @OA\Schema(type="string",enum={"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "unknown", "other"})
|
||||
* ),
|
||||
*
|
||||
* @OA\Parameter(
|
||||
|
@ -130,16 +130,25 @@ final class DefaultAnimeRepository extends DatabaseRepository implements AnimeRe
|
||||
|
||||
$finalFilter = [];
|
||||
|
||||
// if the premiered parameter for the filter is not null, look for those items which have a premiered attribute set,
|
||||
// and equals to the parameter value, OR look for those items which doesn't have premired attribute set,
|
||||
// they don't have a garbled aired string and their aired.from date is within the from-to parameters range
|
||||
if ($premiered !== null) {
|
||||
$finalFilter['$or'] = [
|
||||
["premiered" => $premiered],
|
||||
[
|
||||
"premiered" => null,
|
||||
"aired.string" => [
|
||||
'$not' => ['$regex' => "{$from->year} to ?"]
|
||||
],
|
||||
...$airedFilter
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$finalFilter = array_merge($finalFilter, $airedFilter);
|
||||
$finalFilter["aired.string"] = [
|
||||
'$not' => ['$regex' => "{$from->year} to ?"]
|
||||
];
|
||||
}
|
||||
|
||||
if (!is_null($type)) {
|
||||
|
@ -2299,6 +2299,8 @@
|
||||
"wednesday",
|
||||
"thursday",
|
||||
"friday",
|
||||
"saturday",
|
||||
"sunday",
|
||||
"unknown",
|
||||
"other"
|
||||
]
|
||||
@ -4261,7 +4263,7 @@
|
||||
"music",
|
||||
"cm",
|
||||
"pv",
|
||||
"tv-special"
|
||||
"tv_special"
|
||||
]
|
||||
},
|
||||
"characters_search_query_orderby": {
|
||||
@ -4390,8 +4392,7 @@
|
||||
"oneshot",
|
||||
"doujin",
|
||||
"manhwa",
|
||||
"manhua",
|
||||
"one-shot"
|
||||
"manhua"
|
||||
]
|
||||
},
|
||||
"people_search_query_orderby": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user