Skip to content

Commit

Permalink
fix: Automatically prepend https for Overseerr, Sonarr and Radarr whe…
Browse files Browse the repository at this point in the history
…n choosing port 443
  • Loading branch information
Thijn authored and jorenn92 committed Mar 25, 2024
1 parent e0c4dca commit 1616cfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ui/src/components/Settings/Overseerr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ const OverseerrSettings = () => {
? hostnameRef.current.value
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: 'http://' + hostnameRef.current.value
: portRef.current.value == '443'
? 'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

const payload = {
overseerr_url: addPortToUrl(hostnameVal, +portRef.current.value),
overseerr_api_key: apiKeyRef.current.value,
Expand Down
6 changes: 4 additions & 2 deletions ui/src/components/Settings/Radarr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ const RadarrSettings = () => {
portRef.current?.value &&
apiKeyRef.current?.value
) {
const hostnameVal = hostnameRef.current.value.includes('http')
const hostnameVal = hostnameRef.current.value.includes('http://')
? hostnameRef.current.value
: hostnameRef.current.value.includes('https')
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: portRef.current.value == '443' ?
'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

let radarr_url = `${addPortToUrl(hostnameVal, +portRef.current.value)}`
Expand Down
6 changes: 4 additions & 2 deletions ui/src/components/Settings/Sonarr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ const SonarrSettings = () => {
portRef.current?.value &&
apiKeyRef.current?.value
) {
const hostnameVal = hostnameRef.current.value.includes('http')
const hostnameVal = hostnameRef.current.value.includes('http://')
? hostnameRef.current.value
: hostnameRef.current.value.includes('https')
: hostnameRef.current.value.includes('https://')
? hostnameRef.current.value
: portRef.current.value == '443'
? 'https://' + hostnameRef.current.value
: 'http://' + hostnameRef.current.value

let url = `${addPortToUrl(hostnameVal, +portRef.current.value)}`
Expand Down

0 comments on commit 1616cfd

Please sign in to comment.