From 7eaf403044b0563ccfe5423b9ca262ba526750e9 Mon Sep 17 00:00:00 2001 From: Jam <1347620+JamsRepos@users.noreply.github.com> Date: Sat, 4 May 2024 00:10:54 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A9=B9=20Re-write=20plex.tv=20URL'?= =?UTF-8?q?s=20to=20app.plex.tv=20on=20media=20server=20override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/settings/components/Forms/MediaForm.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/wizarr-frontend/src/modules/settings/components/Forms/MediaForm.vue b/apps/wizarr-frontend/src/modules/settings/components/Forms/MediaForm.vue index 274eccf5..0144076b 100644 --- a/apps/wizarr-frontend/src/modules/settings/components/Forms/MediaForm.vue +++ b/apps/wizarr-frontend/src/modules/settings/components/Forms/MediaForm.vue @@ -162,11 +162,14 @@ export default defineComponent({ // Sanitize server_url and server_url_override to remove trailing slashes let server_url = this.serverForm.server_url.trim().replace(/\/$/, ""); - let server_url_override = this.serverForm.server_url_override ? this.serverForm.server_url_override.trim().replace(/\/$/, "") : null; + let server_url_override = this.serverForm.server_url_override ? this.serverForm.server_url_override.trim().replace(/\/$/, "") : ""; + + // Automatically set server_url_override to https://app.plex.tv if it contains plex.tv, otherwise leave it as is + server_url_override = server_url_override && server_url_override.includes('plex.tv') ? 'https://app.plex.tv' : server_url_override; formData.append("server_name", this.serverForm.server_name); formData.append("server_url", server_url); - if (this.serverForm.server_url_override) formData.append("server_url_override", server_url_override); + formData.append("server_url_override", server_url_override); formData.append("server_type", this.serverForm.server_type); formData.append("server_api_key", this.serverForm.server_api_key);