diff --git a/app/Enums/AnimeTypeEnum.php b/app/Enums/AnimeTypeEnum.php index c81a0c0..bdf6e93 100644 --- a/app/Enums/AnimeTypeEnum.php +++ b/app/Enums/AnimeTypeEnum.php @@ -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' ]; } } diff --git a/app/Enums/MangaTypeEnum.php b/app/Enums/MangaTypeEnum.php index 8b583d7..06e2932 100644 --- a/app/Enums/MangaTypeEnum.php +++ b/app/Enums/MangaTypeEnum.php @@ -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' ]; } } diff --git a/app/Http/Controllers/V4DB/ScheduleController.php b/app/Http/Controllers/V4DB/ScheduleController.php index 46cd5e4..8ad4b18 100644 --- a/app/Http/Controllers/V4DB/ScheduleController.php +++ b/app/Http/Controllers/V4DB/ScheduleController.php @@ -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( diff --git a/app/Repositories/DefaultAnimeRepository.php b/app/Repositories/DefaultAnimeRepository.php index 23a9806..e337182 100644 --- a/app/Repositories/DefaultAnimeRepository.php +++ b/app/Repositories/DefaultAnimeRepository.php @@ -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)) { diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 0f4bbca..4a295e4 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -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": {