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) {