Fix baseurl breaking themes

pull/2180/head
Anojh 7 years ago
parent 827ea857e0
commit 738bdb46d7

@ -274,12 +274,6 @@ namespace Ombi.Controllers
public async Task<IActionResult> GetThemeContent([FromQuery]string url)
{
var css = await _githubApi.GetThemesRawContent(url);
var ombiSettings = await OmbiSettings();
if (ombiSettings.BaseUrl != null)
{
int index = css.IndexOf("/api/");
css = css.Insert(index, ombiSettings.BaseUrl);
}
return Content(css, "text/css");
}

@ -85,8 +85,14 @@ O:::::::OOO:::::::Om::::m m::::m m::::mb:::::bbbbbb::::::bi::::::i
</head>
<body>
@{
if (customization.HasPresetTheme)
{
if (customization.HasPresetTheme)
{
if (!string.IsNullOrEmpty(baseUrl))
{
var index = customization.PresetThemeContent.IndexOf("/api/");
customization.PresetThemeContent = customization.PresetThemeContent.Insert(index, "/" + baseUrl);
}
<style>
@Html.Raw(customization.PresetThemeContent)
</style>

Loading…
Cancel
Save