From d0c830e80d389f9e0f48a9b83659331f54630d03 Mon Sep 17 00:00:00 2001 From: sct Date: Fri, 22 Jan 2021 16:01:46 +0000 Subject: [PATCH] fix: show recently added series even if they are not complete --- overseerr-api.yml | 2 +- server/routes/media.ts | 8 +++++++- src/components/Discover/index.tsx | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/overseerr-api.yml b/overseerr-api.yml index c85c1a083..48ff3003b 100644 --- a/overseerr-api.yml +++ b/overseerr-api.yml @@ -3179,7 +3179,7 @@ paths: schema: type: string nullable: true - enum: [all, available, partial, processing, pending] + enum: [all, available, partial, allavailable, processing, pending] - in: query name: sort schema: diff --git a/server/routes/media.ts b/server/routes/media.ts index f7d67d5c3..5d4fda63a 100644 --- a/server/routes/media.ts +++ b/server/routes/media.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { getRepository, FindOperator, FindOneOptions } from 'typeorm'; +import { getRepository, FindOperator, FindOneOptions, In } from 'typeorm'; import Media from '../entity/Media'; import { MediaStatus } from '../constants/media'; import logger from '../logger'; @@ -27,6 +27,12 @@ mediaRoutes.get('/', async (req, res, next) => { case 'partial': statusFilter = MediaStatus.PARTIALLY_AVAILABLE; break; + case 'allavailable': + statusFilter = In([ + MediaStatus.AVAILABLE, + MediaStatus.PARTIALLY_AVAILABLE, + ]); + break; case 'processing': statusFilter = MediaStatus.PROCESSING; break; diff --git a/src/components/Discover/index.tsx b/src/components/Discover/index.tsx index 1a3fccf91..649087787 100644 --- a/src/components/Discover/index.tsx +++ b/src/components/Discover/index.tsx @@ -23,7 +23,7 @@ const Discover: React.FC = () => { const intl = useIntl(); const { data: media, error: mediaError } = useSWR( - '/api/v1/media?filter=available&take=20&sort=mediaAdded' + '/api/v1/media?filter=allavailable&take=20&sort=mediaAdded' ); const {