fix(override-rules): show correct genres for both *arr services (#2155)
This commit is contained in:
@@ -12,7 +12,6 @@ import type {
|
|||||||
TmdbGenre,
|
TmdbGenre,
|
||||||
TmdbKeywordSearchResponse,
|
TmdbKeywordSearchResponse,
|
||||||
} from '@server/api/themoviedb/interfaces';
|
} from '@server/api/themoviedb/interfaces';
|
||||||
import type { GenreSliderItem } from '@server/interfaces/api/discoverInterfaces';
|
|
||||||
import type { UserResultsResponse } from '@server/interfaces/api/userInterfaces';
|
import type { UserResultsResponse } from '@server/interfaces/api/userInterfaces';
|
||||||
import type {
|
import type {
|
||||||
Keyword,
|
Keyword,
|
||||||
@@ -185,9 +184,7 @@ export const GenreSelector = ({
|
|||||||
}, [defaultValue, type]);
|
}, [defaultValue, type]);
|
||||||
|
|
||||||
const loadGenreOptions = async (inputValue: string) => {
|
const loadGenreOptions = async (inputValue: string) => {
|
||||||
const results = await axios.get<GenreSliderItem[]>(
|
const results = await axios.get<TmdbGenre[]>(`/api/v1/genres/${type}`);
|
||||||
`/api/v1/discover/genreslider/${type}`
|
|
||||||
);
|
|
||||||
|
|
||||||
return results.data
|
return results.data
|
||||||
.map((result) => ({
|
.map((result) => ({
|
||||||
@@ -201,7 +198,7 @@ export const GenreSelector = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AsyncSelect
|
<AsyncSelect
|
||||||
key={`genre-select-${defaultDataValue}`}
|
key={`genre-select-${type}-${defaultDataValue}`}
|
||||||
className="react-select-container"
|
className="react-select-container"
|
||||||
classNamePrefix="react-select"
|
classNamePrefix="react-select"
|
||||||
defaultValue={isMulti ? defaultDataValue : defaultDataValue?.[0]}
|
defaultValue={isMulti ? defaultDataValue : defaultDataValue?.[0]}
|
||||||
|
|||||||
@@ -337,7 +337,13 @@ const OverrideRuleModal = ({
|
|||||||
<div className="form-input-area">
|
<div className="form-input-area">
|
||||||
<div className="form-input-field">
|
<div className="form-input-field">
|
||||||
<GenreSelector
|
<GenreSelector
|
||||||
type={values.radarrServiceId ? 'movie' : 'tv'}
|
type={
|
||||||
|
values.radarrServiceId != null
|
||||||
|
? 'movie'
|
||||||
|
: values.sonarrServiceId != null
|
||||||
|
? 'tv'
|
||||||
|
: 'tv'
|
||||||
|
}
|
||||||
defaultValue={values.genre}
|
defaultValue={values.genre}
|
||||||
isMulti
|
isMulti
|
||||||
isDisabled={!isValidated || isTesting}
|
isDisabled={!isValidated || isTesting}
|
||||||
|
|||||||
Reference in New Issue
Block a user