1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-19 21:46:50 -04:00

New: Release type options for Calendar page

This commit is contained in:
Bogdan
2025-05-29 23:44:23 +03:00
parent e7d76350ec
commit 9df2368601
7 changed files with 117 additions and 19 deletions
@@ -7,6 +7,9 @@ import { CalendarItem } from 'typings/Calendar';
interface CalendarOptions { interface CalendarOptions {
showMovieInformation: boolean; showMovieInformation: boolean;
showCinemaRelease: boolean;
showDigitalRelease: boolean;
showPhysicalRelease: boolean;
showCutoffUnmetIcon: boolean; showCutoffUnmetIcon: boolean;
fullColorEvents: boolean; fullColorEvents: boolean;
} }
+2 -1
View File
@@ -48,9 +48,10 @@ function createMissingMovieIdsSelector() {
if ( if (
!movie.movieFileId && !movie.movieFileId &&
inCinemas &&
moment(inCinemas).isAfter(start) && moment(inCinemas).isAfter(start) &&
moment(inCinemas).isBefore(end) && moment(inCinemas).isBefore(end) &&
isBefore(movie.inCinemas) && isBefore(inCinemas) &&
!queueDetails.some( !queueDetails.some(
(details) => !!details.movie && details.movie.id === movie.id (details) => !!details.movie && details.movie.id === movie.id
) )
+12 -10
View File
@@ -21,27 +21,29 @@ function sort(items: CalendarEventModel[]) {
function createCalendarEventsConnector(date: string) { function createCalendarEventsConnector(date: string) {
return createSelector( return createSelector(
(state: AppState) => state.calendar.items, (state: AppState) => state.calendar.items,
(items) => { (state: AppState) => state.calendar.options,
(items, options) => {
const { showCinemaRelease, showDigitalRelease, showPhysicalRelease } =
options;
const momentDate = moment(date); const momentDate = moment(date);
const filtered = items.filter( const filtered = items.filter(
({ inCinemas, digitalRelease, physicalRelease }) => { ({ inCinemas, digitalRelease, physicalRelease }) => {
return ( return (
(inCinemas && momentDate.isSame(moment(inCinemas), 'day')) || (showCinemaRelease &&
(digitalRelease && inCinemas &&
momentDate.isSame(moment(inCinemas), 'day')) ||
(showDigitalRelease &&
digitalRelease &&
momentDate.isSame(moment(digitalRelease), 'day')) || momentDate.isSame(moment(digitalRelease), 'day')) ||
(physicalRelease && (showPhysicalRelease &&
physicalRelease &&
momentDate.isSame(moment(physicalRelease), 'day')) momentDate.isSame(moment(physicalRelease), 'day'))
); );
} }
); );
return sort( return sort(filtered);
filtered.map((item) => ({
isGroup: false,
...item,
}))
);
} }
); );
} }
+32 -6
View File
@@ -52,8 +52,14 @@ function CalendarEvent({
const { enableColorImpairedMode } = useSelector(createUISettingsSelector()); const { enableColorImpairedMode } = useSelector(createUISettingsSelector());
const { showMovieInformation, showCutoffUnmetIcon, fullColorEvents } = const {
useSelector((state: AppState) => state.calendar.options); showMovieInformation,
showCinemaRelease,
showDigitalRelease,
showPhysicalRelease,
showCutoffUnmetIcon,
fullColorEvents,
} = useSelector((state: AppState) => state.calendar.options);
const isDownloading = !!(queueItem || grabbed); const isDownloading = !!(queueItem || grabbed);
const statusStyle = getStatusStyle( const statusStyle = getStatusStyle(
@@ -70,20 +76,40 @@ function CalendarEvent({
const types = []; const types = [];
if (inCinemas && momentDate.isSame(moment(inCinemas), 'day')) { if (
showCinemaRelease &&
inCinemas &&
momentDate.isSame(moment(inCinemas), 'day')
) {
types.push('Cinemas'); types.push('Cinemas');
} }
if (digitalRelease && momentDate.isSame(moment(digitalRelease), 'day')) { if (
showDigitalRelease &&
digitalRelease &&
momentDate.isSame(moment(digitalRelease), 'day')
) {
types.push('Digital'); types.push('Digital');
} }
if (physicalRelease && momentDate.isSame(moment(physicalRelease), 'day')) { if (
showPhysicalRelease &&
physicalRelease &&
momentDate.isSame(moment(physicalRelease), 'day')
) {
types.push('Physical'); types.push('Physical');
} }
return types; return types;
}, [date, inCinemas, digitalRelease, physicalRelease]); }, [
date,
showCinemaRelease,
showDigitalRelease,
showPhysicalRelease,
inCinemas,
digitalRelease,
physicalRelease,
]);
return ( return (
<div <div
@@ -33,8 +33,14 @@ function CalendarOptionsModalContent({
}: CalendarOptionsModalContentProps) { }: CalendarOptionsModalContentProps) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { showMovieInformation, showCutoffUnmetIcon, fullColorEvents } = const {
useSelector((state: AppState) => state.calendar.options); showMovieInformation,
showCinemaRelease,
showDigitalRelease,
showPhysicalRelease,
showCutoffUnmetIcon,
fullColorEvents,
} = useSelector((state: AppState) => state.calendar.options);
const uiSettings = useSelector(createUISettingsSelector()); const uiSettings = useSelector(createUISettingsSelector());
@@ -96,6 +102,57 @@ function CalendarOptionsModalContent({
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>{translate('ShowCinemaRelease')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showCinemaRelease"
value={showCinemaRelease}
helpText={translate('ShowCinemaReleaseCalendarHelpText')}
isDisabled={
showCinemaRelease &&
!showDigitalRelease &&
!showPhysicalRelease
}
onChange={handleOptionInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('ShowDigitalRelease')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showDigitalRelease"
value={showDigitalRelease}
helpText={translate('ShowDigitalReleaseCalendarHelpText')}
isDisabled={
!showCinemaRelease &&
showDigitalRelease &&
!showPhysicalRelease
}
onChange={handleOptionInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('ShowPhysicalRelease')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showPhysicalRelease"
value={showPhysicalRelease}
helpText={translate('ShowPhysicalReleaseCalendarHelpText')}
isDisabled={
!showCinemaRelease &&
!showDigitalRelease &&
showPhysicalRelease
}
onChange={handleOptionInputChange}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel>{translate('IconForCutoffUnmet')}</FormLabel> <FormLabel>{translate('IconForCutoffUnmet')}</FormLabel>
@@ -43,6 +43,9 @@ export const defaultState = {
options: { options: {
showMovieInformation: true, showMovieInformation: true,
showCinemaRelease: true,
showDigitalRelease: true,
showPhysicalRelease: true,
showCutoffUnmetIcon: false, showCutoffUnmetIcon: false,
fullColorEvents: false fullColorEvents: false
}, },
@@ -1762,10 +1762,14 @@
"ShortDateFormat": "Short Date Format", "ShortDateFormat": "Short Date Format",
"ShowAdvanced": "Show Advanced", "ShowAdvanced": "Show Advanced",
"ShowCertification": "Show Certification", "ShowCertification": "Show Certification",
"ShowCinemaRelease": "Show Cinema Release",
"ShowCinemaReleaseCalendarHelpText": "Show cinema releases in the calendar events",
"ShowCinemaReleaseDate": "Show Cinema Release Date", "ShowCinemaReleaseDate": "Show Cinema Release Date",
"ShowCinemaReleaseDatePosterHelpText": "Show cinema release date under poster", "ShowCinemaReleaseDatePosterHelpText": "Show cinema release date under poster",
"ShowCollectionDetails": "Show Collection Status", "ShowCollectionDetails": "Show Collection Status",
"ShowDateAdded": "Show Date Added", "ShowDateAdded": "Show Date Added",
"ShowDigitalRelease": "Show Digital Release",
"ShowDigitalReleaseCalendarHelpText": "Show digital releases in the calendar events",
"ShowDigitalReleaseDate": "Show Digital Release Date", "ShowDigitalReleaseDate": "Show Digital Release Date",
"ShowDigitalReleaseDatePosterHelpText": "Show digital release date under poster", "ShowDigitalReleaseDatePosterHelpText": "Show digital release date under poster",
"ShowGenres": "Show Genres", "ShowGenres": "Show Genres",
@@ -1777,6 +1781,8 @@
"ShowMovieInformationHelpText": "Show movie genres and certification", "ShowMovieInformationHelpText": "Show movie genres and certification",
"ShowOverview": "Show Overview", "ShowOverview": "Show Overview",
"ShowPath": "Show Path", "ShowPath": "Show Path",
"ShowPhysicalRelease": "Show Physical Release",
"ShowPhysicalReleaseCalendarHelpText": "Show physical releases in the calendar events",
"ShowPhysicalReleaseDate": "Show Physical Release Date", "ShowPhysicalReleaseDate": "Show Physical Release Date",
"ShowPhysicalReleaseDatePosterHelpText": "Show physical release date under poster", "ShowPhysicalReleaseDatePosterHelpText": "Show physical release date under poster",
"ShowPosters": "Show Posters", "ShowPosters": "Show Posters",