New: Search library by TheTVDB, TV Maze or IMDB IDs

This commit is contained in:
Bogdan 2023-06-21 05:29:15 +03:00 committed by GitHub
parent 0a05781aca
commit 377e5f7fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 0 deletions

View File

@ -18,6 +18,9 @@ function createCleanSeriesSelector() {
sortTitle, sortTitle,
images, images,
alternateTitles = [], alternateTitles = [],
tvdbId,
tvMazeId,
imdbId,
tags = [] tags = []
} = series; } = series;
@ -27,6 +30,9 @@ function createCleanSeriesSelector() {
sortTitle, sortTitle,
images, images,
alternateTitles, alternateTitles,
tvdbId,
tvMazeId,
imdbId,
firstCharacter: title.charAt(0).toLowerCase(), firstCharacter: title.charAt(0).toLowerCase(),
tags: tags.reduce((acc, id) => { tags: tags.reduce((acc, id) => {
const matchingTag = allTags.find((tag) => tag.id === id); const matchingTag = allTags.find((tag) => tag.id === id);

View File

@ -11,6 +11,9 @@ function SeriesSearchResult(props) {
title, title,
images, images,
alternateTitles, alternateTitles,
tvdbId,
tvMazeId,
imdbId,
tags tags
} = props; } = props;
@ -46,6 +49,30 @@ function SeriesSearchResult(props) {
null null
} }
{
match.key === 'tvdbId' && tvdbId ?
<div className={styles.alternateTitle}>
TvdbId: {tvdbId}
</div> :
null
}
{
match.key === 'tvMazeId' && tvMazeId ?
<div className={styles.alternateTitle}>
TvMazeId: {tvMazeId}
</div> :
null
}
{
match.key === 'imdbId' && imdbId ?
<div className={styles.alternateTitle}>
ImdbId: {imdbId}
</div> :
null
}
{ {
tag ? tag ?
<div className={styles.tagContainer}> <div className={styles.tagContainer}>
@ -67,6 +94,9 @@ SeriesSearchResult.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,
alternateTitles: 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, tags: PropTypes.arrayOf(PropTypes.object).isRequired,
match: PropTypes.object.isRequired match: PropTypes.object.isRequired
}; };

View File

@ -10,6 +10,9 @@ const fuseOptions = {
keys: [ keys: [
'title', 'title',
'alternateTitles.title', 'alternateTitles.title',
'tvdbId',
'tvMazeId',
'imdbId',
'tags.label' 'tags.label'
] ]
}; };