From 23a4c9af21a06bb255a9db57a5a9fc84abe3a018 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 2 Aug 2012 08:51:43 -0400 Subject: [PATCH] Uncommented ReloadConfiguration and updated GetAllUsers to return a dummy user, in order to unblock UI development. --- MediaBrowser.Common/Kernel/BaseKernel.cs | 28 ++---- .../MediaBrowser.Common.csproj.orig | 92 +++++++++++++++++++ MediaBrowser.Controller/Kernel.cs | 65 ++----------- 3 files changed, 108 insertions(+), 77 deletions(-) create mode 100644 MediaBrowser.Common/MediaBrowser.Common.csproj.orig diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 2420a50911..02de6dee67 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -145,27 +145,19 @@ namespace MediaBrowser.Common.Kernel { //Configuration information for anything other than server-specific configuration will have to come via the API... -ebr - //// Deserialize config - //if (!File.Exists(ConfigurationPath)) - //{ - // Configuration = new TConfigurationType(); - //} - //else - //{ - // Configuration = JsonSerializer.DeserializeFromFile(ConfigurationPath); - //} + // Deserialize config + if (!File.Exists(ApplicationPaths.ConfigurationPath)) + { + Configuration = new TConfigurationType(); + } + else + { + Configuration = JsonSerializer.DeserializeFromFile(ApplicationPaths.ConfigurationPath); + } - //Logger.LoggerInstance.LogSeverity = Configuration.LogSeverity; + Logger.LoggerInstance.LogSeverity = Configuration.LogSeverity; } - /// - /// Saves the current application configuration to the config file - /// - //public void SaveConfiguration() - //{ - // JsonSerializer.SerializeToFile(Configuration, ConfigurationPath); - //} - /// /// Restarts the Http Server, or starts it if not currently running /// diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj.orig b/MediaBrowser.Common/MediaBrowser.Common.csproj.orig new file mode 100644 index 0000000000..326bbe424b --- /dev/null +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj.orig @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {9142EEFA-7570-41E1-BFCC-468BB571AF2F} + Library + Properties + MediaBrowser.Common + MediaBrowser.Common + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\packages\ServiceStack.Text.3.9.3\lib\net35\ServiceStack.Text.dll + + + + + + + False + ..\packages\Rx-Main.1.0.11226\lib\Net4\System.Reactive.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b} + MediaBrowser.Model + + + + + + \ No newline at end of file diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index 6d936f785d..7b257e90dc 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -38,15 +38,6 @@ namespace MediaBrowser.Controller return ApplicationPaths.RootFolderPath; } } - - //gonna want to load this from the standard repository... -ebr - //private string UsersPath - //{ - // get - // { - // return Path.Combine(ProgramDataPath, "Users"); - // } - //} /// /// Gets the list of currently registered entity resolvers @@ -436,61 +427,17 @@ namespace MediaBrowser.Controller /// private IEnumerable GetAllUsers() { - //we'll get this from the standard repo... -ebr - - //if (!Directory.Exists(UsersPath)) - //{ - // Directory.CreateDirectory(UsersPath); - //} - List list = new List(); - //foreach (string folder in Directory.GetDirectories(UsersPath, "*", SearchOption.TopDirectoryOnly)) - //{ - // User item = GetFromDirectory(folder); + // Return a dummy user for now since all calls to get items requre a userId + User user = new User(); - // if (item != null) - // { - // list.Add(item); - // } - //} + user.Name = "Default User"; + user.Id = Guid.NewGuid(); + + list.Add(user); return list; } - - /// - /// Gets a User from it's directory - /// - //private User GetFromDirectory(string path) - //{ - // string file = Path.Combine(path, "user.js"); - - // return JsonSerializer.DeserializeFromFile(file); - //} - - /// - /// Creates a User with a given name - /// - //public User CreateUser(string name) - //{ - // var now = DateTime.Now; - - // User user = new User() - // { - // Name = name, - // Id = Guid.NewGuid(), - // DateCreated = now, - // DateModified = now - // }; - - // user.Path = Path.Combine(UsersPath, user.Id.ToString()); - - // Directory.CreateDirectory(user.Path); - - // JsonSerializer.SerializeToFile(user, Path.Combine(user.Path, "user.js")); - - // return user; - //} - } }