New: RSS Sync button on Calendar

Closes #3326
pull/3660/head
Mark McDowall 5 years ago
parent a965b8e7b2
commit 3b6d60e904

@ -6,6 +6,7 @@ import Measure from 'Components/Measure';
import PageContentBodyConnector from 'Components/Page/PageContentBodyConnector'; import PageContentBodyConnector from 'Components/Page/PageContentBodyConnector';
import PageToolbar from 'Components/Page/Toolbar/PageToolbar'; import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection'; import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton'; import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
import FilterMenu from 'Components/Menu/FilterMenu'; import FilterMenu from 'Components/Menu/FilterMenu';
import NoSeries from 'Series/NoSeries'; import NoSeries from 'Series/NoSeries';
@ -76,8 +77,10 @@ class CalendarPage extends Component {
filters, filters,
hasSeries, hasSeries,
missingEpisodeIds, missingEpisodeIds,
isRssSyncExecuting,
isSearchingForMissing, isSearchingForMissing,
useCurrentPage, useCurrentPage,
onRssSyncPress,
onFilterSelect onFilterSelect
} = this.props; } = this.props;
@ -99,6 +102,15 @@ class CalendarPage extends Component {
onPress={this.onGetCalendarLinkPress} onPress={this.onGetCalendarLinkPress}
/> />
<PageToolbarSeparator />
<PageToolbarButton
label="RSS Sync"
iconName={icons.RSS}
isSpinning={isRssSyncExecuting}
onPress={onRssSyncPress}
/>
<PageToolbarButton <PageToolbarButton
label="Search for Missing" label="Search for Missing"
iconName={icons.SEARCH} iconName={icons.SEARCH}
@ -168,10 +180,12 @@ CalendarPage.propTypes = {
filters: PropTypes.arrayOf(PropTypes.object).isRequired, filters: PropTypes.arrayOf(PropTypes.object).isRequired,
hasSeries: PropTypes.bool.isRequired, hasSeries: PropTypes.bool.isRequired,
missingEpisodeIds: PropTypes.arrayOf(PropTypes.number).isRequired, missingEpisodeIds: PropTypes.arrayOf(PropTypes.number).isRequired,
isRssSyncExecuting: PropTypes.bool.isRequired,
isSearchingForMissing: PropTypes.bool.isRequired, isSearchingForMissing: PropTypes.bool.isRequired,
useCurrentPage: PropTypes.bool.isRequired, useCurrentPage: PropTypes.bool.isRequired,
onSearchMissingPress: PropTypes.func.isRequired, onSearchMissingPress: PropTypes.func.isRequired,
onDaysCountChange: PropTypes.func.isRequired, onDaysCountChange: PropTypes.func.isRequired,
onRssSyncPress: PropTypes.func.isRequired,
onFilterSelect: PropTypes.func.isRequired onFilterSelect: PropTypes.func.isRequired
}; };

@ -3,11 +3,14 @@ import { createSelector } from 'reselect';
import moment from 'moment'; import moment from 'moment';
import { isCommandExecuting } from 'Utilities/Command'; import { isCommandExecuting } from 'Utilities/Command';
import isBefore from 'Utilities/Date/isBefore'; import isBefore from 'Utilities/Date/isBefore';
import * as commandNames from 'Commands/commandNames';
import withCurrentPage from 'Components/withCurrentPage'; import withCurrentPage from 'Components/withCurrentPage';
import { executeCommand } from 'Store/Actions/commandActions';
import { searchMissing, setCalendarDaysCount, setCalendarFilter } from 'Store/Actions/calendarActions'; import { searchMissing, setCalendarDaysCount, setCalendarFilter } from 'Store/Actions/calendarActions';
import createSeriesCountSelector from 'Store/Selectors/createSeriesCountSelector'; import createSeriesCountSelector from 'Store/Selectors/createSeriesCountSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector'; import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import CalendarPage from './CalendarPage'; import CalendarPage from './CalendarPage';
function createMissingEpisodeIdsSelector() { function createMissingEpisodeIdsSelector() {
@ -59,6 +62,7 @@ function createMapStateToProps() {
createSeriesCountSelector(), createSeriesCountSelector(),
createUISettingsSelector(), createUISettingsSelector(),
createMissingEpisodeIdsSelector(), createMissingEpisodeIdsSelector(),
createCommandExecutingSelector(commandNames.RSS_SYNC),
createIsSearchingSelector(), createIsSearchingSelector(),
( (
selectedFilterKey, selectedFilterKey,
@ -66,6 +70,7 @@ function createMapStateToProps() {
seriesCount, seriesCount,
uiSettings, uiSettings,
missingEpisodeIds, missingEpisodeIds,
isRssSyncExecuting,
isSearchingForMissing isSearchingForMissing
) => { ) => {
return { return {
@ -74,6 +79,7 @@ function createMapStateToProps() {
colorImpairedMode: uiSettings.enableColorImpairedMode, colorImpairedMode: uiSettings.enableColorImpairedMode,
hasSeries: !!seriesCount, hasSeries: !!seriesCount,
missingEpisodeIds, missingEpisodeIds,
isRssSyncExecuting,
isSearchingForMissing isSearchingForMissing
}; };
} }
@ -82,6 +88,12 @@ function createMapStateToProps() {
function createMapDispatchToProps(dispatch, props) { function createMapDispatchToProps(dispatch, props) {
return { return {
onRssSyncPress() {
dispatch(executeCommand({
name: commandNames.RSS_SYNC
}));
},
onSearchMissingPress(episodeIds) { onSearchMissingPress(episodeIds) {
dispatch(searchMissing({ episodeIds })); dispatch(searchMissing({ episodeIds }));
}, },

Loading…
Cancel
Save