removed ClientSettings

This commit is contained in:
kay.one 2013-08-05 19:37:13 -07:00
parent a2db70bb19
commit 247b72282f
2 changed files with 0 additions and 38 deletions

View File

@ -1,37 +0,0 @@
using System.IO;
using System.Text.RegularExpressions;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Messaging;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Lifecycle;
namespace NzbDrone.Api.Client
{
public class ClientSettings : IHandle<ApplicationStartedEvent>
{
private readonly IAppFolderInfo _appFolderInfo;
private static readonly Regex VersionRegex = new Regex(@"(?<=Version:\s')(.*)(?=')", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex BuildDateRegex = new Regex(@"(?<=BuildDate:\s)('.*')", RegexOptions.IgnoreCase | RegexOptions.Compiled);
public ClientSettings(IAppFolderInfo appFolderInfo)
{
_appFolderInfo = appFolderInfo;
}
public void Handle(ApplicationStartedEvent message)
{
//TODO: Update the APIKey (when we have it)
var appFile = Path.Combine(_appFolderInfo.StartUpFolder, "UI", "app.js");
var contents = File.ReadAllText(appFile);
var version = BuildInfo.Version;
var date = BuildInfo.BuildDateTime;
contents = VersionRegex.Replace(contents, version.ToString());
contents = BuildDateRegex.Replace(contents, date.ToUniversalTime().ToJson());
File.WriteAllText(appFile, contents);
}
}
}

View File

@ -81,7 +81,6 @@
<Compile Include="ClientSchema\Field.cs" /> <Compile Include="ClientSchema\Field.cs" />
<Compile Include="ClientSchema\SchemaBuilder.cs" /> <Compile Include="ClientSchema\SchemaBuilder.cs" />
<Compile Include="ClientSchema\SelectOption.cs" /> <Compile Include="ClientSchema\SelectOption.cs" />
<Compile Include="Client\ClientSettings.cs" />
<Compile Include="Commands\CommandModule.cs" /> <Compile Include="Commands\CommandModule.cs" />
<Compile Include="Commands\CommandResource.cs" /> <Compile Include="Commands\CommandResource.cs" />
<Compile Include="Config\NamingConfigResource.cs" /> <Compile Include="Config\NamingConfigResource.cs" />