mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-29 23:12:39 +01:00
parent
c41e3ce1e3
commit
cfc4b6e0a0
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Sonarr",
|
"name": "__INSTANCE_NAME__",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "__URL_BASE__/Content/Images/Icons/android-chrome-192x192.png",
|
"src": "__URL_BASE__/Content/Images/Icons/android-chrome-192x192.png",
|
||||||
|
@ -8,9 +8,14 @@ namespace Sonarr.Http.Frontend.Mappers
|
|||||||
{
|
{
|
||||||
public class ManifestMapper : UrlBaseReplacementResourceMapperBase
|
public class ManifestMapper : UrlBaseReplacementResourceMapperBase
|
||||||
{
|
{
|
||||||
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
|
|
||||||
|
private string _generatedContent;
|
||||||
|
|
||||||
public ManifestMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, IConfigFileProvider configFileProvider, Logger logger)
|
public ManifestMapper(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider, IConfigFileProvider configFileProvider, Logger logger)
|
||||||
: base(diskProvider, configFileProvider, logger)
|
: base(diskProvider, configFileProvider, logger)
|
||||||
{
|
{
|
||||||
|
_configFileProvider = configFileProvider;
|
||||||
FilePath = Path.Combine(appFolderInfo.StartUpFolder, configFileProvider.UiFolder, "Content", "manifest.json");
|
FilePath = Path.Combine(appFolderInfo.StartUpFolder, configFileProvider.UiFolder, "Content", "manifest.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,5 +28,21 @@ namespace Sonarr.Http.Frontend.Mappers
|
|||||||
{
|
{
|
||||||
return resourceUrl.StartsWith("/Content/manifest");
|
return resourceUrl.StartsWith("/Content/manifest");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override string GetFileText()
|
||||||
|
{
|
||||||
|
if (RuntimeInfo.IsProduction && _generatedContent != null)
|
||||||
|
{
|
||||||
|
return _generatedContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
var text = base.GetFileText();
|
||||||
|
|
||||||
|
text = text.Replace("__INSTANCE_NAME__", _configFileProvider.InstanceName);
|
||||||
|
|
||||||
|
_generatedContent = text;
|
||||||
|
|
||||||
|
return _generatedContent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user