From 247b72282fddeed79d76b2f32ee5489525f72470 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 5 Aug 2013 19:37:13 -0700 Subject: [PATCH] removed ClientSettings --- NzbDrone.Api/Client/ClientSettings.cs | 37 --------------------------- NzbDrone.Api/NzbDrone.Api.csproj | 1 - 2 files changed, 38 deletions(-) delete mode 100644 NzbDrone.Api/Client/ClientSettings.cs diff --git a/NzbDrone.Api/Client/ClientSettings.cs b/NzbDrone.Api/Client/ClientSettings.cs deleted file mode 100644 index 7deff82d2..000000000 --- a/NzbDrone.Api/Client/ClientSettings.cs +++ /dev/null @@ -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 - { - 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); - } - } -} diff --git a/NzbDrone.Api/NzbDrone.Api.csproj b/NzbDrone.Api/NzbDrone.Api.csproj index 49934fb6f..7fae02668 100644 --- a/NzbDrone.Api/NzbDrone.Api.csproj +++ b/NzbDrone.Api/NzbDrone.Api.csproj @@ -81,7 +81,6 @@ -