Skip to content

Commit 8323f75

Browse files
committed
feat(settings): warn Non released setting
1 parent 6905d8c commit 8323f75

10 files changed

Lines changed: 60 additions & 11 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-jellyseerr/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 Blacklisted Items
8288

8389
When enabled, media that has been blacklisted 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 blacklisted when you have the "Manage Blacklist" 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
@@ -30,6 +30,7 @@ export interface PublicSettingsResponse {
3030
applicationTitle: string;
3131
applicationUrl: string;
3232
hideAvailable: boolean;
33+
warnNonReleased: boolean;
3334
hideBlacklisted: boolean;
3435
localLogin: boolean;
3536
mediaServerLogin: boolean;

server/lib/settings/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export interface MainSettings {
133133
};
134134
hideAvailable: boolean;
135135
hideBlacklisted: boolean;
136+
warnNonReleased: boolean;
136137
localLogin: boolean;
137138
mediaServerLogin: boolean;
138139
newPlexLogin: boolean;
@@ -182,6 +183,7 @@ interface FullPublicSettings extends PublicSettings {
182183
applicationUrl: string;
183184
hideAvailable: boolean;
184185
hideBlacklisted: boolean;
186+
warnNonReleased: boolean;
185187
localLogin: boolean;
186188
mediaServerLogin: boolean;
187189
movie4kEnabled: boolean;
@@ -390,6 +392,7 @@ class Settings {
390392
},
391393
hideAvailable: false,
392394
hideBlacklisted: false,
395+
warnNonReleased: false,
393396
localLogin: true,
394397
mediaServerLogin: true,
395398
newPlexLogin: true,
@@ -672,6 +675,7 @@ class Settings {
672675
applicationUrl: this.data.main.applicationUrl,
673676
hideAvailable: this.data.main.hideAvailable,
674677
hideBlacklisted: this.data.main.hideBlacklisted,
678+
warnNonReleased: this.data.main.warnNonReleased,
675679
localLogin: this.data.main.localLogin,
676680
mediaServerLogin: this.data.main.mediaServerLogin,
677681
jellyfinExternalHost: this.data.jellyfin.externalHostname,

src/components/RequestModal/MovieRequestModal.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,18 @@ const MovieRequestModal = ({
354354
okButtonType={'primary'}
355355
backdrop={`https://image.tmdb.org/t/p/w1920_and_h800_multi_faces/${data?.backdropPath}`}
356356
>
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 && (
357+
{settings.currentSettings.warnNonReleased &&
358+
!nonTheatricalReleases?.length && (
359+
<div className="mt-6">
360+
<Alert
361+
title={intl.formatMessage(
362+
messages.requestMovieHasNoNonTheatricalRealease
363+
)}
364+
type="warning"
365+
/>
366+
</div>
367+
)}
368+
{settings.currentSettings.warnNonReleased && nonTheatricalInTheFuture && (
368369
<div className="mt-6">
369370
<Alert
370371
title={intl.formatMessage(

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
hideBlacklisted: data?.hideBlacklisted,
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
hideBlacklisted: values.hideBlacklisted,
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
hideBlacklisted: false,
17+
warnNonReleased: false,
1718
localLogin: true,
1819
mediaServerLogin: true,
1920
movie4kEnabled: false,

src/i18n/locale/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@
977977
"components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Seerr.",
978978
"components.Settings.SettingsMain.hideAvailable": "Hide Available Media",
979979
"components.Settings.SettingsMain.hideAvailableTip": "Hide available media from the discover pages but not search results",
980+
"components.Settings.SettingsMain.warnNonReleased": "Warn about request if not yet released",
981+
"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",
980982
"components.Settings.SettingsMain.hideBlacklisted": "Hide Blacklisted Items",
981983
"components.Settings.SettingsMain.hideBlacklistedTip": "Hide blacklisted items from discover pages for all users with the \"Manage Blacklist\" permission",
982984
"components.Settings.SettingsMain.locale": "Display Language",

src/pages/_app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ CoreApp.getInitialProps = async (initialProps) => {
232232
applicationUrl: '',
233233
hideAvailable: false,
234234
hideBlacklisted: false,
235+
warnNonReleased: false,
235236
movie4kEnabled: false,
236237
series4kEnabled: false,
237238
localLogin: true,

0 commit comments

Comments
 (0)