From 543d36e5615341bc8378cac377b843a3dbc1ef99 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 15 Oct 2021 11:34:32 +0100 Subject: [PATCH] fix: :bug: Really really fix it this time? --- src/Ombi/Program.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ombi/Program.cs b/src/Ombi/Program.cs index 60e1a8732..7f7a875d1 100644 --- a/src/Ombi/Program.cs +++ b/src/Ombi/Program.cs @@ -20,6 +20,7 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging; using Ombi.Api.TheMovieDb.Models; using System.Net.Http; +using System.Text.RegularExpressions; namespace Ombi { @@ -269,17 +270,16 @@ namespace Ombi var indexHtml = await File.ReadAllTextAsync(indexPath); var sb = new StringBuilder(indexHtml); - var headPosition = indexHtml.IndexOf("window.+=.+;<.script>"; + const string baseUrlRegex = ""; - sb.Remove(headPosition, firstLinkPosition - headPosition - 6); + indexHtml = Regex.Replace(indexHtml, scriptRegex, $""); - sb.Insert(headPosition + 6, - $""); + indexHtml = Regex.Replace(indexHtml, baseUrlRegex, $""); try { - await File.WriteAllTextAsync(indexPath, sb.ToString()); + await File.WriteAllTextAsync(indexPath, indexHtml); } catch (UnauthorizedAccessException) {