fix: various fixes for new tags feature (#1369)

* fix(backend): fix movie override tags check

* fix(lang): fix 'no tags' and 'anime tags' strings

* fix(logging): correct capitalization of Radarr/Sonarr

* fix(ui): consistently disable tag select / display loading placeholder
pull/1352/head
TheCatLady 4 years ago committed by GitHub
parent 7a5c4a30b5
commit b4450a308c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -361,7 +361,7 @@ export class MediaRequest {
const settings = getSettings(); const settings = getSettings();
if (settings.radarr.length === 0 && !settings.radarr[0]) { if (settings.radarr.length === 0 && !settings.radarr[0]) {
logger.info( logger.info(
'Skipped radarr request as there is no radarr configured', 'Skipped Radarr request as there is no Radarr server configured',
{ label: 'Media Request' } { label: 'Media Request' }
); );
return; return;
@ -389,7 +389,9 @@ export class MediaRequest {
logger.info( logger.info(
`There is no default ${ `There is no default ${
this.is4k ? '4K ' : '' this.is4k ? '4K ' : ''
}radarr configured. Did you set any of your Radarr servers as default?`, }Radarr server configured. Did you set any of your ${
this.is4k ? '4K ' : ''
}Radarr servers as default?`,
{ label: 'Media Request' } { label: 'Media Request' }
); );
return; return;
@ -420,11 +422,7 @@ export class MediaRequest {
}); });
} }
if ( if (this.tags && !isEqual(this.tags, radarrSettings.tags)) {
this.tags &&
(radarrSettings.tags.length !== (this.tags?.length ?? 0) ||
radarrSettings.tags.every((num) => (this.tags ?? []).includes(num)))
) {
tags = this.tags; tags = this.tags;
logger.info(`Request has override tags`, { logger.info(`Request has override tags`, {
label: 'Media Request', label: 'Media Request',
@ -505,7 +503,7 @@ export class MediaRequest {
}); });
logger.info('Sent request to Radarr', { label: 'Media Request' }); logger.info('Sent request to Radarr', { label: 'Media Request' });
} catch (e) { } catch (e) {
const errorMessage = `Request failed to send to radarr: ${e.message}`; const errorMessage = `Request failed to send to Radarr: ${e.message}`;
logger.error('Request failed to send to Radarr', { logger.error('Request failed to send to Radarr', {
label: 'Media Request', label: 'Media Request',
errorMessage, errorMessage,
@ -525,7 +523,7 @@ export class MediaRequest {
const settings = getSettings(); const settings = getSettings();
if (settings.sonarr.length === 0 && !settings.sonarr[0]) { if (settings.sonarr.length === 0 && !settings.sonarr[0]) {
logger.info( logger.info(
'Skipped sonarr request as there is no sonarr configured', 'Skipped Sonarr request as there is no Sonarr server configured',
{ label: 'Media Request' } { label: 'Media Request' }
); );
return; return;
@ -553,7 +551,9 @@ export class MediaRequest {
logger.info( logger.info(
`There is no default ${ `There is no default ${
this.is4k ? '4K ' : '' this.is4k ? '4K ' : ''
}sonarr configured. Did you set any of your Sonarr servers as default?`, }Sonarr server configured. Did you set any of your ${
this.is4k ? '4K ' : ''
}Sonarr servers as default?`,
{ label: 'Media Request' } { label: 'Media Request' }
); );
return; return;
@ -654,7 +654,7 @@ export class MediaRequest {
tags = this.tags; tags = this.tags;
logger.info(`Request has override tags`, { logger.info(`Request has override tags`, {
label: 'Media Request', label: 'Media Request',
tags, tagIds: tags,
}); });
} }
@ -719,7 +719,7 @@ export class MediaRequest {
}); });
logger.info('Sent request to Sonarr', { label: 'Media Request' }); logger.info('Sent request to Sonarr', { label: 'Media Request' });
} catch (e) { } catch (e) {
const errorMessage = `Request failed to send to sonarr: ${e.message}`; const errorMessage = `Request failed to send to Sonarr: ${e.message}`;
logger.error('Request failed to send to Sonarr', { logger.error('Request failed to send to Sonarr', {
label: 'Media Request', label: 'Media Request',
errorMessage, errorMessage,

@ -35,7 +35,7 @@ const messages = defineMessages({
languageprofile: 'Language Profile', languageprofile: 'Language Profile',
tags: 'Tags', tags: 'Tags',
selecttags: 'Select tags', selecttags: 'Select tags',
notagoptions: 'No Tags', notagoptions: 'No tags.',
}); });
export type RequestOverrides = { export type RequestOverrides = {
@ -466,7 +466,12 @@ const AdvancedRequester: React.FC<AdvancedRequesterProps> = ({
value: tag.id, value: tag.id,
}))} }))}
isMulti isMulti
placeholder={intl.formatMessage(messages.selecttags)} isDisabled={isValidating || !serverData}
placeholder={
isValidating || !serverData
? intl.formatMessage(globalMessages.loading)
: intl.formatMessage(messages.selecttags)
}
className="react-select-container react-select-container-dark" className="react-select-container react-select-container-dark"
classNamePrefix="react-select" classNamePrefix="react-select"
value={selectedTags.map((tagId) => { value={selectedTags.map((tagId) => {

@ -59,6 +59,7 @@ const messages = defineMessages({
testFirstQualityProfiles: 'Test connection to load quality profiles', testFirstQualityProfiles: 'Test connection to load quality profiles',
loadingrootfolders: 'Loading root folders…', loadingrootfolders: 'Loading root folders…',
testFirstRootFolders: 'Test connection to load root folders', testFirstRootFolders: 'Test connection to load root folders',
loadingTags: 'Loading tags…',
testFirstTags: 'Test connection to load tags', testFirstTags: 'Test connection to load tags',
tags: 'Tags', tags: 'Tags',
preventSearch: 'Disable Auto-Search', preventSearch: 'Disable Auto-Search',
@ -66,7 +67,7 @@ const messages = defineMessages({
validationApplicationUrlTrailingSlash: 'URL must not end in a trailing slash', validationApplicationUrlTrailingSlash: 'URL must not end in a trailing slash',
validationBaseUrlLeadingSlash: 'Base URL must have a leading slash', validationBaseUrlLeadingSlash: 'Base URL must have a leading slash',
validationBaseUrlTrailingSlash: 'Base URL must not end in a trailing slash', validationBaseUrlTrailingSlash: 'Base URL must not end in a trailing slash',
notagoptions: 'No Tags', notagoptions: 'No tags.',
selecttags: 'Select tags', selecttags: 'Select tags',
}); });
@ -631,10 +632,12 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
: [] : []
} }
isMulti isMulti
isDisabled={!isValidated} isDisabled={!isValidated || isTesting}
placeholder={ placeholder={
!isValidated !isValidated
? intl.formatMessage(messages.testFirstTags) ? intl.formatMessage(messages.testFirstTags)
: isTesting
? intl.formatMessage(messages.loadingTags)
: intl.formatMessage(messages.selecttags) : intl.formatMessage(messages.selecttags)
} }
className="react-select-container" className="react-select-container"

@ -72,8 +72,8 @@ const messages = defineMessages({
validationBaseUrlLeadingSlash: 'Base URL must have a leading slash', validationBaseUrlLeadingSlash: 'Base URL must have a leading slash',
validationBaseUrlTrailingSlash: 'Base URL must not end in a trailing slash', validationBaseUrlTrailingSlash: 'Base URL must not end in a trailing slash',
tags: 'Tags', tags: 'Tags',
animeTags: 'Tags', animeTags: 'Anime Tags',
notagoptions: 'No Tags', notagoptions: 'No tags.',
selecttags: 'Select tags', selecttags: 'Select tags',
}); });
@ -685,7 +685,7 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
: [] : []
} }
isMulti isMulti
isDisabled={!isValidated} isDisabled={!isValidated || isTesting}
placeholder={ placeholder={
!isValidated !isValidated
? intl.formatMessage(messages.testFirstTags) ? intl.formatMessage(messages.testFirstTags)

@ -176,7 +176,7 @@
"components.RequestModal.AdvancedRequester.destinationserver": "Destination Server", "components.RequestModal.AdvancedRequester.destinationserver": "Destination Server",
"components.RequestModal.AdvancedRequester.folder": "{path} ({space})", "components.RequestModal.AdvancedRequester.folder": "{path} ({space})",
"components.RequestModal.AdvancedRequester.languageprofile": "Language Profile", "components.RequestModal.AdvancedRequester.languageprofile": "Language Profile",
"components.RequestModal.AdvancedRequester.notagoptions": "No Tags", "components.RequestModal.AdvancedRequester.notagoptions": "No tags.",
"components.RequestModal.AdvancedRequester.qualityprofile": "Quality Profile", "components.RequestModal.AdvancedRequester.qualityprofile": "Quality Profile",
"components.RequestModal.AdvancedRequester.requestas": "Request As", "components.RequestModal.AdvancedRequester.requestas": "Request As",
"components.RequestModal.AdvancedRequester.rootfolder": "Root Folder", "components.RequestModal.AdvancedRequester.rootfolder": "Root Folder",
@ -332,10 +332,11 @@
"components.Settings.RadarrModal.externalUrl": "External URL", "components.Settings.RadarrModal.externalUrl": "External URL",
"components.Settings.RadarrModal.externalUrlPlaceholder": "External URL pointing to your Radarr server", "components.Settings.RadarrModal.externalUrlPlaceholder": "External URL pointing to your Radarr server",
"components.Settings.RadarrModal.hostname": "Hostname or IP Address", "components.Settings.RadarrModal.hostname": "Hostname or IP Address",
"components.Settings.RadarrModal.loadingTags": "Loading tags…",
"components.Settings.RadarrModal.loadingprofiles": "Loading quality profiles…", "components.Settings.RadarrModal.loadingprofiles": "Loading quality profiles…",
"components.Settings.RadarrModal.loadingrootfolders": "Loading root folders…", "components.Settings.RadarrModal.loadingrootfolders": "Loading root folders…",
"components.Settings.RadarrModal.minimumAvailability": "Minimum Availability", "components.Settings.RadarrModal.minimumAvailability": "Minimum Availability",
"components.Settings.RadarrModal.notagoptions": "No Tags", "components.Settings.RadarrModal.notagoptions": "No tags.",
"components.Settings.RadarrModal.port": "Port", "components.Settings.RadarrModal.port": "Port",
"components.Settings.RadarrModal.preventSearch": "Disable Auto-Search", "components.Settings.RadarrModal.preventSearch": "Disable Auto-Search",
"components.Settings.RadarrModal.qualityprofile": "Quality Profile", "components.Settings.RadarrModal.qualityprofile": "Quality Profile",
@ -443,7 +444,7 @@
"components.Settings.SettingsUsers.userSettingsDescription": "Configure global and default user settings.", "components.Settings.SettingsUsers.userSettingsDescription": "Configure global and default user settings.",
"components.Settings.SettingsUsers.users": "Users", "components.Settings.SettingsUsers.users": "Users",
"components.Settings.SonarrModal.add": "Add Server", "components.Settings.SonarrModal.add": "Add Server",
"components.Settings.SonarrModal.animeTags": "Tags", "components.Settings.SonarrModal.animeTags": "Anime Tags",
"components.Settings.SonarrModal.animelanguageprofile": "Anime Language Profile", "components.Settings.SonarrModal.animelanguageprofile": "Anime Language Profile",
"components.Settings.SonarrModal.animequalityprofile": "Anime Quality Profile", "components.Settings.SonarrModal.animequalityprofile": "Anime Quality Profile",
"components.Settings.SonarrModal.animerootfolder": "Anime Root Folder", "components.Settings.SonarrModal.animerootfolder": "Anime Root Folder",
@ -465,7 +466,7 @@
"components.Settings.SonarrModal.loadinglanguageprofiles": "Loading language profiles…", "components.Settings.SonarrModal.loadinglanguageprofiles": "Loading language profiles…",
"components.Settings.SonarrModal.loadingprofiles": "Loading quality profiles…", "components.Settings.SonarrModal.loadingprofiles": "Loading quality profiles…",
"components.Settings.SonarrModal.loadingrootfolders": "Loading root folders…", "components.Settings.SonarrModal.loadingrootfolders": "Loading root folders…",
"components.Settings.SonarrModal.notagoptions": "No Tags", "components.Settings.SonarrModal.notagoptions": "No tags.",
"components.Settings.SonarrModal.port": "Port", "components.Settings.SonarrModal.port": "Port",
"components.Settings.SonarrModal.preventSearch": "Disable Auto-Search", "components.Settings.SonarrModal.preventSearch": "Disable Auto-Search",
"components.Settings.SonarrModal.qualityprofile": "Quality Profile", "components.Settings.SonarrModal.qualityprofile": "Quality Profile",

Loading…
Cancel
Save