mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Indexer and Search page work
This commit is contained in:
@@ -3,12 +3,12 @@ import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import tagShape from 'Helpers/Props/Shapes/tagShape';
|
||||
import { fetchIndexers } from 'Store/Actions/settingsActions';
|
||||
import { fetchIndexers } from 'Store/Actions/indexerActions';
|
||||
import FilterBuilderRowValue from './FilterBuilderRowValue';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.settings.indexers,
|
||||
(state) => state.indexers,
|
||||
(qualityProfiles) => {
|
||||
const {
|
||||
isFetching,
|
||||
|
@@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import Label from 'Components/Label';
|
||||
import { kinds } from 'Helpers/Props';
|
||||
import MoviePoster from 'Indexer/MoviePoster';
|
||||
import styles from './MovieSearchResult.css';
|
||||
|
||||
function MovieSearchResult(props) {
|
||||
@@ -10,7 +9,6 @@ function MovieSearchResult(props) {
|
||||
match,
|
||||
title,
|
||||
year,
|
||||
images,
|
||||
alternateTitles,
|
||||
tags
|
||||
} = props;
|
||||
@@ -26,14 +24,6 @@ function MovieSearchResult(props) {
|
||||
|
||||
return (
|
||||
<div className={styles.result}>
|
||||
<MoviePoster
|
||||
className={styles.poster}
|
||||
images={images}
|
||||
size={250}
|
||||
lazy={false}
|
||||
overflow={true}
|
||||
/>
|
||||
|
||||
<div className={styles.titles}>
|
||||
<div className={styles.title}>
|
||||
{title} { year > 0 ? `(${year})` : ''}
|
||||
@@ -67,7 +57,6 @@ function MovieSearchResult(props) {
|
||||
MovieSearchResult.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
year: PropTypes.number.isRequired,
|
||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
tags: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
match: PropTypes.object.isRequired
|
||||
|
@@ -5,6 +5,7 @@ import { withRouter } from 'react-router-dom';
|
||||
import { createSelector } from 'reselect';
|
||||
import { saveDimensions, setIsSidebarVisible } from 'Store/Actions/appActions';
|
||||
import { fetchCustomFilters } from 'Store/Actions/customFilterActions';
|
||||
import { fetchIndexers } from 'Store/Actions/indexerActions';
|
||||
import { fetchIndexerFlags, fetchLanguages, fetchUISettings } from 'Store/Actions/settingsActions';
|
||||
import { fetchStatus } from 'Store/Actions/systemActions';
|
||||
import { fetchTags } from 'Store/Actions/tagActions';
|
||||
@@ -46,6 +47,7 @@ const selectIsPopulated = createSelector(
|
||||
(state) => state.tags.isPopulated,
|
||||
(state) => state.settings.ui.isPopulated,
|
||||
(state) => state.settings.languages.isPopulated,
|
||||
(state) => state.indexers.isPopulated,
|
||||
(state) => state.settings.indexerFlags.isPopulated,
|
||||
(state) => state.system.status.isPopulated,
|
||||
(
|
||||
@@ -53,6 +55,7 @@ const selectIsPopulated = createSelector(
|
||||
tagsIsPopulated,
|
||||
uiSettingsIsPopulated,
|
||||
languagesIsPopulated,
|
||||
indexersIsPopulated,
|
||||
indexerFlagsIsPopulated,
|
||||
systemStatusIsPopulated
|
||||
) => {
|
||||
@@ -61,6 +64,7 @@ const selectIsPopulated = createSelector(
|
||||
tagsIsPopulated &&
|
||||
uiSettingsIsPopulated &&
|
||||
languagesIsPopulated &&
|
||||
indexersIsPopulated &&
|
||||
indexerFlagsIsPopulated &&
|
||||
systemStatusIsPopulated
|
||||
);
|
||||
@@ -72,6 +76,7 @@ const selectErrors = createSelector(
|
||||
(state) => state.tags.error,
|
||||
(state) => state.settings.ui.error,
|
||||
(state) => state.settings.languages.error,
|
||||
(state) => state.indexers.error,
|
||||
(state) => state.settings.indexerFlags.error,
|
||||
(state) => state.system.status.error,
|
||||
(
|
||||
@@ -79,6 +84,7 @@ const selectErrors = createSelector(
|
||||
tagsError,
|
||||
uiSettingsError,
|
||||
languagesError,
|
||||
indexersError,
|
||||
indexerFlagsError,
|
||||
systemStatusError
|
||||
) => {
|
||||
@@ -87,6 +93,7 @@ const selectErrors = createSelector(
|
||||
tagsError ||
|
||||
uiSettingsError ||
|
||||
languagesError ||
|
||||
indexersError ||
|
||||
indexerFlagsError ||
|
||||
systemStatusError
|
||||
);
|
||||
@@ -97,6 +104,7 @@ const selectErrors = createSelector(
|
||||
tagsError,
|
||||
uiSettingsError,
|
||||
languagesError,
|
||||
indexersError,
|
||||
indexerFlagsError,
|
||||
systemStatusError
|
||||
};
|
||||
@@ -139,6 +147,9 @@ function createMapDispatchToProps(dispatch, props) {
|
||||
dispatchFetchLanguages() {
|
||||
dispatch(fetchLanguages());
|
||||
},
|
||||
dispatchFetchIndexers() {
|
||||
dispatch(fetchIndexers());
|
||||
},
|
||||
dispatchFetchIndexerFlags() {
|
||||
dispatch(fetchIndexerFlags());
|
||||
},
|
||||
@@ -175,6 +186,7 @@ class PageConnector extends Component {
|
||||
this.props.dispatchFetchCustomFilters();
|
||||
this.props.dispatchFetchTags();
|
||||
this.props.dispatchFetchLanguages();
|
||||
this.props.dispatchFetchIndexers();
|
||||
this.props.dispatchFetchIndexerFlags();
|
||||
this.props.dispatchFetchUISettings();
|
||||
this.props.dispatchFetchStatus();
|
||||
@@ -197,6 +209,7 @@ class PageConnector extends Component {
|
||||
hasError,
|
||||
dispatchFetchTags,
|
||||
dispatchFetchLanguages,
|
||||
dispatchFetchIndexers,
|
||||
dispatchFetchIndexerFlags,
|
||||
dispatchFetchUISettings,
|
||||
dispatchFetchStatus,
|
||||
@@ -234,6 +247,7 @@ PageConnector.propTypes = {
|
||||
dispatchFetchCustomFilters: PropTypes.func.isRequired,
|
||||
dispatchFetchTags: PropTypes.func.isRequired,
|
||||
dispatchFetchLanguages: PropTypes.func.isRequired,
|
||||
dispatchFetchIndexers: PropTypes.func.isRequired,
|
||||
dispatchFetchIndexerFlags: PropTypes.func.isRequired,
|
||||
dispatchFetchUISettings: PropTypes.func.isRequired,
|
||||
dispatchFetchStatus: PropTypes.func.isRequired,
|
||||
|
@@ -6,7 +6,7 @@ import { createSelector } from 'reselect';
|
||||
import { setAppValue, setVersion } from 'Store/Actions/appActions';
|
||||
import { removeItem, update, updateItem } from 'Store/Actions/baseActions';
|
||||
import { fetchCommands, finishCommand, updateCommand } from 'Store/Actions/commandActions';
|
||||
import { fetchMovies } from 'Store/Actions/movieActions';
|
||||
import { fetchIndexers } from 'Store/Actions/indexerActions';
|
||||
import { fetchHealth } from 'Store/Actions/systemActions';
|
||||
import { fetchTagDetails, fetchTags } from 'Store/Actions/tagActions';
|
||||
import { repopulatePage } from 'Utilities/pagePopulator';
|
||||
@@ -42,7 +42,7 @@ const mapDispatchToProps = {
|
||||
dispatchUpdateItem: updateItem,
|
||||
dispatchRemoveItem: removeItem,
|
||||
dispatchFetchHealth: fetchHealth,
|
||||
dispatchFetchMovies: fetchMovies,
|
||||
dispatchFetchIndexers: fetchIndexers,
|
||||
dispatchFetchTags: fetchTags,
|
||||
dispatchFetchTagDetails: fetchTagDetails
|
||||
};
|
||||
@@ -225,7 +225,7 @@ class SignalRConnector extends Component {
|
||||
|
||||
const {
|
||||
dispatchFetchCommands,
|
||||
dispatchFetchMovies,
|
||||
dispatchFetchIndexers,
|
||||
dispatchSetAppValue
|
||||
} = this.props;
|
||||
|
||||
@@ -238,7 +238,7 @@ class SignalRConnector extends Component {
|
||||
|
||||
// Repopulate the page (if a repopulator is set) to ensure things
|
||||
// are in sync after reconnecting.
|
||||
dispatchFetchMovies();
|
||||
dispatchFetchIndexers();
|
||||
dispatchFetchCommands();
|
||||
repopulatePage();
|
||||
}
|
||||
@@ -273,7 +273,7 @@ SignalRConnector.propTypes = {
|
||||
dispatchUpdateItem: PropTypes.func.isRequired,
|
||||
dispatchRemoveItem: PropTypes.func.isRequired,
|
||||
dispatchFetchHealth: PropTypes.func.isRequired,
|
||||
dispatchFetchMovies: PropTypes.func.isRequired,
|
||||
dispatchFetchIndexers: PropTypes.func.isRequired,
|
||||
dispatchFetchTags: PropTypes.func.isRequired,
|
||||
dispatchFetchTagDetails: PropTypes.func.isRequired
|
||||
};
|
||||
|
Reference in New Issue
Block a user