Skip to content

Commit

Permalink
fix: 🩹 Re-write plex.tv URL's to app.plex.tv on media server override
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsRepos committed May 3, 2024
1 parent 71cd75a commit 7eaf403
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7eaf403

Please sign in to comment.