From b50f78e5da6f3fdfc59e577ca61b88771da7d211 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 12 Jul 2012 02:55:27 -0400 Subject: Initial check-in --- MediaBrowser.Program/Program.cs | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 MediaBrowser.Program/Program.cs (limited to 'MediaBrowser.Program/Program.cs') diff --git a/MediaBrowser.Program/Program.cs b/MediaBrowser.Program/Program.cs new file mode 100644 index 000000000..668869685 --- /dev/null +++ b/MediaBrowser.Program/Program.cs @@ -0,0 +1,48 @@ +using System; +using System.Configuration; +using System.IO; +using MediaBrowser.Controller; + +namespace MediaBrowser.Program +{ + class Program + { + static void Main(string[] args) + { + LoadKernel(); + } + + private static void LoadKernel() + { + DateTime now = DateTime.Now; + + Console.WriteLine("Loading"); + + string installDir = ConfigurationManager.AppSettings["DataPath"]; + + if (!Path.IsPathRooted(installDir)) + { + string path = System.Reflection.Assembly.GetExecutingAssembly().Location; + path = Path.GetDirectoryName(path); + + installDir = Path.Combine(path, installDir); + + installDir = Path.GetFullPath(installDir); + } + + if (!Directory.Exists(installDir)) + { + Directory.CreateDirectory(installDir); + } + + Kernel kernel = new Kernel(installDir); + + kernel.Init(); + + var time = DateTime.Now - now; + Console.WriteLine("Done in " + time.TotalSeconds + " seconds"); + Console.WriteLine("Press Enter to quit."); + Console.ReadLine(); + } + } +} -- cgit v1.2.3