mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
@@ -50,7 +50,7 @@ class TagsModalContent extends Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
movieTags,
|
||||
indexerTags,
|
||||
tagList,
|
||||
onModalClose
|
||||
} = this.props;
|
||||
@@ -108,7 +108,7 @@ class TagsModalContent extends Component {
|
||||
|
||||
<div className={styles.result}>
|
||||
{
|
||||
movieTags.map((t) => {
|
||||
indexerTags.map((t) => {
|
||||
const tag = _.find(tagList, { id: t });
|
||||
|
||||
if (!tag) {
|
||||
@@ -140,7 +140,7 @@ class TagsModalContent extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (movieTags.indexOf(t) > -1) {
|
||||
if (indexerTags.indexOf(t) > -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ class TagsModalContent extends Component {
|
||||
}
|
||||
|
||||
TagsModalContent.propTypes = {
|
||||
movieTags: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||
indexerTags: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
onModalClose: PropTypes.func.isRequired,
|
||||
onApplyTagsPress: PropTypes.func.isRequired
|
||||
|
||||
@@ -10,15 +10,15 @@ function createMapStateToProps() {
|
||||
(state, { indexerIds }) => indexerIds,
|
||||
createAllIndexersSelector(),
|
||||
createTagsSelector(),
|
||||
(indexerIds, allMovies, tagList) => {
|
||||
const movies = _.intersectionWith(allMovies, indexerIds, (s, id) => {
|
||||
(indexerIds, allIndexers, tagList) => {
|
||||
const indexers = _.intersectionWith(allIndexers, indexerIds, (s, id) => {
|
||||
return s.id === id;
|
||||
});
|
||||
|
||||
const movieTags = _.uniq(_.concat(..._.map(movies, 'tags')));
|
||||
const indexerTags = _.uniq(_.concat(..._.map(indexers, 'tags')));
|
||||
|
||||
return {
|
||||
movieTags,
|
||||
indexerTags,
|
||||
tagList
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user