From 377e5f7fc7bb070a2f6e55a6bc8f2bdad733c308 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 21 Jun 2023 05:29:15 +0300 Subject: [PATCH] New: Search library by TheTVDB, TV Maze or IMDB IDs --- .../Page/Header/SeriesSearchInputConnector.js | 6 ++++ .../Page/Header/SeriesSearchResult.js | 30 +++++++++++++++++++ .../src/Components/Page/Header/fuse.worker.js | 3 ++ 3 files changed, 39 insertions(+) diff --git a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js index 9b9e07117..afa6f25aa 100644 --- a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js +++ b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js @@ -18,6 +18,9 @@ function createCleanSeriesSelector() { sortTitle, images, alternateTitles = [], + tvdbId, + tvMazeId, + imdbId, tags = [] } = series; @@ -27,6 +30,9 @@ function createCleanSeriesSelector() { sortTitle, images, alternateTitles, + tvdbId, + tvMazeId, + imdbId, firstCharacter: title.charAt(0).toLowerCase(), tags: tags.reduce((acc, id) => { const matchingTag = allTags.find((tag) => tag.id === id); diff --git a/frontend/src/Components/Page/Header/SeriesSearchResult.js b/frontend/src/Components/Page/Header/SeriesSearchResult.js index 11f54c9a0..c43e87605 100644 --- a/frontend/src/Components/Page/Header/SeriesSearchResult.js +++ b/frontend/src/Components/Page/Header/SeriesSearchResult.js @@ -11,6 +11,9 @@ function SeriesSearchResult(props) { title, images, alternateTitles, + tvdbId, + tvMazeId, + imdbId, tags } = props; @@ -46,6 +49,30 @@ function SeriesSearchResult(props) { null } + { + match.key === 'tvdbId' && tvdbId ? +
+ TvdbId: {tvdbId} +
: + null + } + + { + match.key === 'tvMazeId' && tvMazeId ? +
+ TvMazeId: {tvMazeId} +
: + null + } + + { + match.key === 'imdbId' && imdbId ? +
+ ImdbId: {imdbId} +
: + null + } + { tag ?
@@ -67,6 +94,9 @@ SeriesSearchResult.propTypes = { title: PropTypes.string.isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired, alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired, + tvdbId: PropTypes.number, + tvMazeId: PropTypes.number, + imdbId: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.object).isRequired, match: PropTypes.object.isRequired }; diff --git a/frontend/src/Components/Page/Header/fuse.worker.js b/frontend/src/Components/Page/Header/fuse.worker.js index b8dfa87a0..53a3fd1fd 100644 --- a/frontend/src/Components/Page/Header/fuse.worker.js +++ b/frontend/src/Components/Page/Header/fuse.worker.js @@ -10,6 +10,9 @@ const fuseOptions = { keys: [ 'title', 'alternateTitles.title', + 'tvdbId', + 'tvMazeId', + 'imdbId', 'tags.label' ] };