|
|
@ -10,24 +10,24 @@ import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
|
|
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
|
|
|
|
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
|
|
|
|
import CalendarPage from './CalendarPage';
|
|
|
|
import CalendarPage from './CalendarPage';
|
|
|
|
|
|
|
|
|
|
|
|
function createMissingEpisodeIdsSelector() {
|
|
|
|
function createMissingMovieIdsSelector() {
|
|
|
|
return createSelector(
|
|
|
|
return createSelector(
|
|
|
|
(state) => state.calendar.start,
|
|
|
|
(state) => state.calendar.start,
|
|
|
|
(state) => state.calendar.end,
|
|
|
|
(state) => state.calendar.end,
|
|
|
|
(state) => state.calendar.items,
|
|
|
|
(state) => state.calendar.items,
|
|
|
|
(state) => state.queue.details.items,
|
|
|
|
(state) => state.queue.details.items,
|
|
|
|
(start, end, episodes, queueDetails) => {
|
|
|
|
(start, end, movies, queueDetails) => {
|
|
|
|
return episodes.reduce((acc, episode) => {
|
|
|
|
return movies.reduce((acc, movie) => {
|
|
|
|
const airDateUtc = episode.airDateUtc;
|
|
|
|
const inCinemas = movie.inCinemas;
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
!episode.episodeFileId &&
|
|
|
|
!movie.movieFileId &&
|
|
|
|
moment(airDateUtc).isAfter(start) &&
|
|
|
|
moment(inCinemas).isAfter(start) &&
|
|
|
|
moment(airDateUtc).isBefore(end) &&
|
|
|
|
moment(inCinemas).isBefore(end) &&
|
|
|
|
isBefore(episode.airDateUtc) &&
|
|
|
|
isBefore(movie.inCinemas) &&
|
|
|
|
!queueDetails.some((details) => !!details.episode && details.episode.id === episode.id)
|
|
|
|
!queueDetails.some((details) => !!details.movie && details.movie.id === movie.id)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
acc.push(episode.id);
|
|
|
|
acc.push(movie.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return acc;
|
|
|
|
return acc;
|
|
|
@ -58,14 +58,14 @@ function createMapStateToProps() {
|
|
|
|
(state) => state.calendar.filters,
|
|
|
|
(state) => state.calendar.filters,
|
|
|
|
createMovieCountSelector(),
|
|
|
|
createMovieCountSelector(),
|
|
|
|
createUISettingsSelector(),
|
|
|
|
createUISettingsSelector(),
|
|
|
|
createMissingEpisodeIdsSelector(),
|
|
|
|
createMissingMovieIdsSelector(),
|
|
|
|
createIsSearchingSelector(),
|
|
|
|
createIsSearchingSelector(),
|
|
|
|
(
|
|
|
|
(
|
|
|
|
selectedFilterKey,
|
|
|
|
selectedFilterKey,
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
movieCount,
|
|
|
|
movieCount,
|
|
|
|
uiSettings,
|
|
|
|
uiSettings,
|
|
|
|
missingEpisodeIds,
|
|
|
|
missingMovieIds,
|
|
|
|
isSearchingForMissing
|
|
|
|
isSearchingForMissing
|
|
|
|
) => {
|
|
|
|
) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -73,7 +73,7 @@ function createMapStateToProps() {
|
|
|
|
filters,
|
|
|
|
filters,
|
|
|
|
colorImpairedMode: uiSettings.enableColorImpairedMode,
|
|
|
|
colorImpairedMode: uiSettings.enableColorImpairedMode,
|
|
|
|
hasMovie: !!movieCount,
|
|
|
|
hasMovie: !!movieCount,
|
|
|
|
missingEpisodeIds,
|
|
|
|
missingMovieIds,
|
|
|
|
isSearchingForMissing
|
|
|
|
isSearchingForMissing
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -82,8 +82,8 @@ function createMapStateToProps() {
|
|
|
|
|
|
|
|
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
|
|
function createMapDispatchToProps(dispatch, props) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
onSearchMissingPress(episodeIds) {
|
|
|
|
onSearchMissingPress(movieIds) {
|
|
|
|
dispatch(searchMissing({ episodeIds }));
|
|
|
|
dispatch(searchMissing({ movieIds }));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onDaysCountChange(dayCount) {
|
|
|
|
onDaysCountChange(dayCount) {
|
|
|
|