Skip to content

Commit ec8d9fa

Browse files
committed
feat(settings): warn Non released setting
1 parent 64438b8 commit ec8d9fa

11 files changed

Lines changed: 75 additions & 24 deletions

File tree

cypress/config/settings.cypress.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"tv": {}
1414
},
1515
"hideAvailable": false,
16+
"warnNonReleased": false,
1617
"localLogin": true,
1718
"newPlexLogin": true,
1819
"discoverRegion": "",

docs/using-seerr/settings/general.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Available media will still appear in search results, however, so it is possible
7878

7979
This setting is **disabled** by default.
8080

81+
## Warn about Non-released
82+
83+
When enabled, Movies or Series that don't have any release (still only in theatres, or not yet released) will show a warning : this prevents requests that can't yet be fulfilled
84+
85+
This setting is **disabled** by default.
86+
8187
## Hide Blocklisted Items
8288

8389
When enabled, media that has been blocklisted will not appear on the "Discover" home page, for all administrators. This can be useful to hide content that you don't want to see, such as content with specific tags or content that has been manually blocklisted when you have the "Manage Blocklist" permission.

seerr-api.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ components:
236236
hideAvailable:
237237
type: boolean
238238
example: false
239+
warnNonReleased:
240+
type: boolean
241+
example: false
239242
partialRequestsEnabled:
240243
type: boolean
241244
example: false

server/interfaces/api/settingsInterfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface PublicSettingsResponse {
3131
applicationUrl: string;
3232
hideAvailable: boolean;
3333
hideBlocklisted: boolean;
34+
warnNonReleased: boolean;
3435
localLogin: boolean;
3536
mediaServerLogin: boolean;
3637
movie4kEnabled: boolean;

server/lib/settings/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export interface MainSettings {
134134
};
135135
hideAvailable: boolean;
136136
hideBlocklisted: boolean;
137+
warnNonReleased: boolean;
137138
localLogin: boolean;
138139
mediaServerLogin: boolean;
139140
newPlexLogin: boolean;
@@ -184,6 +185,7 @@ interface FullPublicSettings extends PublicSettings {
184185
applicationUrl: string;
185186
hideAvailable: boolean;
186187
hideBlocklisted: boolean;
188+
warnNonReleased: boolean;
187189
localLogin: boolean;
188190
mediaServerLogin: boolean;
189191
movie4kEnabled: boolean;
@@ -394,6 +396,7 @@ class Settings {
394396
},
395397
hideAvailable: false,
396398
hideBlocklisted: false,
399+
warnNonReleased: false,
397400
localLogin: true,
398401
mediaServerLogin: true,
399402
newPlexLogin: true,
@@ -678,6 +681,7 @@ class Settings {
678681
applicationUrl: this.data.main.applicationUrl,
679682
hideAvailable: this.data.main.hideAvailable,
680683
hideBlocklisted: this.data.main.hideBlocklisted,
684+
warnNonReleased: this.data.main.warnNonReleased,
681685
localLogin: this.data.main.localLogin,
682686
mediaServerLogin: this.data.main.mediaServerLogin,
683687
jellyfinExternalHost: this.data.jellyfin.externalHostname,

src/components/RequestModal/MovieRequestModal.tsx

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ const messages = defineMessages('components.RequestModal', {
2525
requestCancel: 'Request for <strong>{title}</strong> canceled.',
2626
requestmovietitle: 'Request Movie',
2727
requestmovie4ktitle: 'Request Movie in 4K',
28-
requestmovieNonTheattricalInTheFuture:
29-
'The Digital or Physical release is in the future',
30-
requestMovieHasNoNonTheatricalRealease: 'There is no non-Theatrical Release',
28+
requestmovieNotReleased:
29+
'The Digital or Physical release is absent or in the future',
3130
edit: 'Edit Request',
3231
approve: 'Approve Request',
3332
cancel: 'Cancel Request',
@@ -354,26 +353,15 @@ const MovieRequestModal = ({
354353
okButtonType={'primary'}
355354
backdrop={`https://image.tmdb.org/t/p/w1920_and_h800_multi_faces/${data?.backdropPath}`}
356355
>
357-
{!nonTheatricalReleases?.length && (
358-
<div className="mt-6">
359-
<Alert
360-
title={intl.formatMessage(
361-
messages.requestMovieHasNoNonTheatricalRealease
362-
)}
363-
type="warning"
364-
/>
365-
</div>
366-
)}
367-
{nonTheatricalInTheFuture && (
368-
<div className="mt-6">
369-
<Alert
370-
title={intl.formatMessage(
371-
messages.requestmovieNonTheattricalInTheFuture
372-
)}
373-
type="warning"
374-
/>
375-
</div>
376-
)}
356+
{settings.currentSettings.warnNonReleased &&
357+
(!nonTheatricalReleases?.length || nonTheatricalInTheFuture) && (
358+
<div className="mt-6">
359+
<Alert
360+
title={intl.formatMessage(messages.requestmovieNotReleased)}
361+
type="warning"
362+
/>
363+
</div>
364+
)}
377365
{hasAutoApprove && !quota?.movie.restricted && (
378366
<div className="mt-6">
379367
<Alert

src/components/RequestModal/TvRequestModal.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const messages = defineMessages('components.RequestModal', {
3838
'Request {seasonCount} {seasonCount, plural, one {Season} other {Seasons}}',
3939
requestseasons4k:
4040
'Request {seasonCount} {seasonCount, plural, one {Season} other {Seasons}} in 4K',
41+
requesttvNotReleased: 'The Air Date is absent or in the future',
4142
alreadyrequested: 'Already Requested',
4243
selectseason: 'Select Season(s)',
4344
season: 'Season',
@@ -382,6 +383,12 @@ const TvRequestModal = ({
382383

383384
const isOwner = editRequest && editRequest.requestedBy.id === user?.id;
384385

386+
const seasonsAirDates = (data?.seasons ?? []).map((season) => season.airDate);
387+
388+
console.log(seasonsAirDates);
389+
390+
const airDateInTheFuture = true;
391+
385392
return data && !error && !data.externalIds.tvdbId && searchModal.show ? (
386393
<SearchByNameModal
387394
tvdbId={tvdbId}
@@ -498,6 +505,15 @@ const TvRequestModal = ({
498505
/>
499506
</p>
500507
)}
508+
{settings.currentSettings.warnNonReleased &&
509+
airDateInTheFuture(
510+
<div className="mt-6">
511+
<Alert
512+
title={intl.formatMessage(messages.requesttvNotReleased)}
513+
type="warning"
514+
/>
515+
</div>
516+
)}
501517
{(quota?.tv.limit ?? 0) > 0 && (
502518
<QuotaDisplay
503519
mediaType="tv"

src/components/Settings/SettingsMain/index.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ const messages = defineMessages('components.Settings.SettingsMain', {
5353
toastApiKeyFailure: 'Something went wrong while generating a new API key.',
5454
toastSettingsSuccess: 'Settings saved successfully!',
5555
toastSettingsFailure: 'Something went wrong while saving settings.',
56+
warnNonReleased: 'Warn if Non released',
57+
warnNonReleasedTip:
58+
"If still only in theatres, or not yet released, Seerr will show a warning to the would-be requester : This prevents requests that can't yet be fulfilled",
5659
hideAvailable: 'Hide Available Media',
5760
hideAvailableTip:
5861
'Hide available media from the discover pages but not search results',
@@ -165,6 +168,7 @@ const SettingsMain = () => {
165168
applicationUrl: data?.applicationUrl,
166169
hideAvailable: data?.hideAvailable,
167170
hideBlocklisted: data?.hideBlocklisted,
171+
warnNonReleased: data?.warnNonReleased,
168172
locale: data?.locale ?? 'en',
169173
discoverRegion: data?.discoverRegion,
170174
originalLanguage: data?.originalLanguage,
@@ -185,6 +189,7 @@ const SettingsMain = () => {
185189
applicationUrl: values.applicationUrl,
186190
hideAvailable: values.hideAvailable,
187191
hideBlocklisted: values.hideBlocklisted,
192+
warnNonReleased: values.warnNonReleased,
188193
locale: values.locale,
189194
discoverRegion: values.discoverRegion,
190195
streamingRegion: values.streamingRegion,
@@ -489,6 +494,30 @@ const SettingsMain = () => {
489494
/>
490495
</div>
491496
</div>
497+
<div className="form-row">
498+
<label htmlFor="warnNonReleased" className="checkbox-label">
499+
<span className="mr-2">
500+
{intl.formatMessage(messages.warnNonReleased)}
501+
</span>
502+
<SettingsBadge badgeType="experimental" />
503+
<span className="label-tip">
504+
{intl.formatMessage(messages.warnNonReleasedTip)}
505+
</span>
506+
</label>
507+
<div className="form-input-area">
508+
<Field
509+
type="checkbox"
510+
id="warnNonReleased"
511+
name="warnNonReleased"
512+
onChange={() => {
513+
setFieldValue(
514+
'warnNonReleased',
515+
!values.warnNonReleased
516+
);
517+
}}
518+
/>
519+
</div>
520+
</div>
492521
<div className="form-row">
493522
<label
494523
htmlFor="partialRequestsEnabled"

src/context/SettingsContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const defaultSettings = {
1414
applicationUrl: '',
1515
hideAvailable: false,
1616
hideBlocklisted: false,
17+
warnNonReleased: false,
1718
localLogin: true,
1819
mediaServerLogin: true,
1920
movie4kEnabled: false,

src/i18n/locale/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@
567567
"components.RequestModal.requestfrom": "{username}'s request is pending approval.",
568568
"components.RequestModal.requestmovie4ktitle": "Request Movie in 4K",
569569
"components.RequestModal.requestmovieNonTheattricalInTheFuture": "The Digital or Physical release is in the future",
570-
"components.RequestModal.requestMovieHasNoNonTheatricalRealease": "There is no non-Theatrical Release",
571570
"components.RequestModal.requestmovies": "Request {count} {count, plural, one {Movie} other {Movies}}",
572571
"components.RequestModal.requestmovies4k": "Request {count} {count, plural, one {Movie} other {Movies}} in 4K",
573572
"components.RequestModal.requestmovietitle": "Request Movie",
@@ -991,6 +990,8 @@
991990
"components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Seerr.",
992991
"components.Settings.SettingsMain.hideAvailable": "Hide Available Media",
993992
"components.Settings.SettingsMain.hideAvailableTip": "Hide available media from the discover pages but not search results",
993+
"components.Settings.SettingsMain.warnNonReleased": "Warn about request if not yet released",
994+
"components.Settings.SettingsMain.warnNonReleasedTip": "When enabled, Movies or Series that don't have any release (still only in theatres) will show a warning : this prevents requests that can't yet be fulfilled",
994995
"components.Settings.SettingsMain.hideBlocklisted": "Hide Blocklisted Items",
995996
"components.Settings.SettingsMain.hideBlocklistedTip": "Hide blocklisted items from discover pages for all users with the \"Manage Blocklist\" permission",
996997
"components.Settings.SettingsMain.locale": "Display Language",

0 commit comments

Comments
 (0)