diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 23:37:50 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 23:37:50 -0500 |
| commit | a5f9dc1bfc6c8d37f915d2ea33e495013bd83ba5 (patch) | |
| tree | 960cabedfbd07fe4eac3503e99f8bab745db58e2 | |
| parent | 509156cbc3497ff8daabefd3dba843f5b085701a (diff) | |
isolated sqlite dependancy
27 files changed, 254 insertions, 145 deletions
diff --git a/MediaBrowser.ApiInteraction.Javascript/ApiClient.js b/MediaBrowser.ApiInteraction.Javascript/ApiClient.js index de8f443d8..0b185a55e 100644 --- a/MediaBrowser.ApiInteraction.Javascript/ApiClient.js +++ b/MediaBrowser.ApiInteraction.Javascript/ApiClient.js @@ -815,8 +815,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, @@ -849,8 +849,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, @@ -883,8 +883,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, @@ -917,8 +917,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, @@ -951,8 +951,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, @@ -987,8 +987,8 @@ var ApiClient = { } // Don't put these on the query string - options.type = null; - options.index = null; + delete options.type; + delete options.index; return ApiClient.getUrl(url, options); }, diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 616a0305c..95e6d05d6 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -116,7 +116,7 @@ namespace MediaBrowser.Common.Kernel /// <param name="newVersion">The new version.</param> public void OnApplicationUpdated(Version newVersion) { - EventHelper.QueueEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<Version> {Argument = newVersion}); + EventHelper.QueueEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<Version> { Argument = newVersion }); NotifyPendingRestart(); } @@ -258,7 +258,7 @@ namespace MediaBrowser.Common.Kernel /// <value>The rest services.</value> [ImportMany(typeof(IRestfulService))] public IEnumerable<IRestfulService> RestServices { get; private set; } - + /// <summary> /// The _protobuf serializer initialized /// </summary> @@ -348,14 +348,20 @@ namespace MediaBrowser.Common.Kernel public Assembly[] Assemblies { get; private set; } /// <summary> - /// Initializes the Kernel + /// Initializes a new instance of the <see cref="BaseKernel{TApplicationPathsType}" /> class. /// </summary> /// <param name="isoManager">The iso manager.</param> - /// <returns>Task.</returns> - public async Task Init(IIsoManager isoManager) + protected BaseKernel(IIsoManager isoManager) { IsoManager = isoManager; + } + /// <summary> + /// Initializes the Kernel + /// </summary> + /// <returns>Task.</returns> + public async Task Init() + { Logger = Logging.LogManager.GetLogger(GetType().Name); ApplicationPaths = new TApplicationPathsType(); @@ -539,10 +545,10 @@ namespace MediaBrowser.Common.Kernel { yield return pluginAssembly; } - + // Include composable parts in the Model assembly - yield return typeof (SystemInfo).Assembly; - + yield return typeof(SystemInfo).Assembly; + // Include composable parts in the Common assembly yield return Assembly.GetExecutingAssembly(); @@ -636,7 +642,7 @@ namespace MediaBrowser.Common.Kernel IsoManager = null; } } - + /// <summary> /// Disposes the TCP manager. /// </summary> @@ -760,7 +766,7 @@ namespace MediaBrowser.Common.Kernel /// The _save lock /// </summary> private readonly object _configurationSaveLock = new object(); - + /// <summary> /// Saves the current configuration /// </summary> diff --git a/MediaBrowser.Common/Kernel/IKernel.cs b/MediaBrowser.Common/Kernel/IKernel.cs index 1a68dd320..5358f3ab0 100644 --- a/MediaBrowser.Common/Kernel/IKernel.cs +++ b/MediaBrowser.Common/Kernel/IKernel.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.Common.Kernel /// Inits this instance. /// </summary> /// <returns>Task.</returns> - Task Init(IIsoManager isoManager); + Task Init(); /// <summary> /// Reloads this instance. diff --git a/MediaBrowser.Common/UI/BaseApplication.cs b/MediaBrowser.Common/UI/BaseApplication.cs index a6e13e3af..72056b59d 100644 --- a/MediaBrowser.Common/UI/BaseApplication.cs +++ b/MediaBrowser.Common/UI/BaseApplication.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Common.IO; -using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Logging; using MediaBrowser.Common.Updates; using MediaBrowser.Model.Logging; @@ -9,7 +8,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Deployment.Application; using System.Net.Cache; -using System.Reflection; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -84,13 +82,6 @@ namespace MediaBrowser.Common.UI protected ILogger Logger { get; set; } /// <summary> - /// Instantiates the iso manager. - /// </summary> - /// <param name="kernel">The kernel.</param> - /// <returns>IIsoManager.</returns> - protected abstract IIsoManager InstantiateIsoManager(IKernel kernel); - - /// <summary> /// Initializes a new instance of the <see cref="BaseApplication" /> class. /// </summary> protected BaseApplication() @@ -176,7 +167,7 @@ namespace MediaBrowser.Common.UI var now = DateTime.UtcNow; - await Kernel.Init(InstantiateIsoManager(Kernel)); + await Kernel.Init(); var done = (DateTime.UtcNow - now); Logger.Info("Kernel.Init completed in {0}{1} minutes and {2} seconds.", done.Hours > 0 ? done.Hours + " Hours " : "", done.Minutes, done.Seconds); diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index 803c4774e..c4d8f3e6c 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.IO; +using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Plugins; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Entities; @@ -6,7 +7,6 @@ using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaInfo; using MediaBrowser.Controller.Persistence; -using MediaBrowser.Controller.Persistence.SQLite; using MediaBrowser.Controller.Playback; using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Providers; @@ -19,10 +19,7 @@ using MediaBrowser.Model.System; using System; using System.Collections.Generic; using System.ComponentModel.Composition; -using System.Diagnostics; -using System.IO; using System.Linq; -using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -303,8 +300,8 @@ namespace MediaBrowser.Controller /// <summary> /// Creates a kernel based on a Data path, which is akin to our current programdata path /// </summary> - public Kernel() - : base() + public Kernel(IIsoManager isoManager) + : base(isoManager) { Instance = this; } @@ -385,19 +382,19 @@ namespace MediaBrowser.Controller await base.OnComposablePartsLoaded().ConfigureAwait(false); // Get the current item repository - ItemRepository = GetRepository(ItemRepositories, Configuration.ItemRepository, SQLiteItemRepository.RepositoryName); + ItemRepository = GetRepository(ItemRepositories, Configuration.ItemRepository); var itemRepoTask = ItemRepository.Initialize(); // Get the current user repository - UserRepository = GetRepository(UserRepositories, Configuration.UserRepository, SQLiteUserRepository.RepositoryName); + UserRepository = GetRepository(UserRepositories, Configuration.UserRepository); var userRepoTask = UserRepository.Initialize(); // Get the current item repository - UserDataRepository = GetRepository(UserDataRepositories, Configuration.UserDataRepository, SQLiteUserDataRepository.RepositoryName); + UserDataRepository = GetRepository(UserDataRepositories, Configuration.UserDataRepository); var userDataRepoTask = UserDataRepository.Initialize(); // Get the current display preferences repository - DisplayPreferencesRepository = GetRepository(DisplayPreferencesRepositories, Configuration.DisplayPreferencesRepository, SQLiteDisplayPreferencesRepository.RepositoryName); + DisplayPreferencesRepository = GetRepository(DisplayPreferencesRepositories, Configuration.DisplayPreferencesRepository); var displayPreferencesRepoTask = DisplayPreferencesRepository.Initialize(); // Sort the resolvers by priority @@ -418,15 +415,14 @@ namespace MediaBrowser.Controller /// <typeparam name="T"></typeparam> /// <param name="repositories">The repositories.</param> /// <param name="name">The name.</param> - /// <param name="defaultName">The default name.</param> /// <returns>``0.</returns> - private T GetRepository<T>(IEnumerable<T> repositories, string name, string defaultName) + private T GetRepository<T>(IEnumerable<T> repositories, string name) where T : class, IRepository { var enumerable = repositories as T[] ?? repositories.ToArray(); - return enumerable.FirstOrDefault(r => r.Name.Equals(name ?? defaultName, StringComparison.OrdinalIgnoreCase)) ?? - enumerable.First(r => r.Name.Equals(defaultName, StringComparison.OrdinalIgnoreCase)); + return enumerable.FirstOrDefault(r => string.Equals(r.Name, name, StringComparison.OrdinalIgnoreCase)) ?? + enumerable.FirstOrDefault(); } /// <summary> diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 88e5ed551..5730b56ed 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -69,14 +69,6 @@ <Reference Include="System" /> <Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.Core" /> - <Reference Include="System.Data.SQLite, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.dll</HintPath> - </Reference> - <Reference Include="System.Data.SQLite.Linq, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath> - </Reference> <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> <Reference Include="System.Net" /> @@ -149,12 +141,6 @@ <Compile Include="Persistence\IRepository.cs" /> <Compile Include="Persistence\IUserDataRepository.cs" /> <Compile Include="Persistence\IUserRepository.cs" /> - <Compile Include="Persistence\SQLite\SQLiteDisplayPreferencesRepository.cs" /> - <Compile Include="Persistence\SQLite\SQLiteExtensions.cs" /> - <Compile Include="Persistence\SQLite\SQLiteItemRepository.cs" /> - <Compile Include="Persistence\SQLite\SQLiteRepository.cs" /> - <Compile Include="Persistence\SQLite\SQLiteUserDataRepository.cs" /> - <Compile Include="Persistence\SQLite\SQLiteUserRepository.cs" /> <Compile Include="Persistence\TypeMapper.cs" /> <Compile Include="Playback\BaseIntroProvider.cs" /> <Compile Include="Plugins\BaseConfigurationPage.cs" /> @@ -251,12 +237,6 @@ </ItemGroup> <ItemGroup> <Content Include="MediaInfo\readme.txt" /> - <Content Include="x64\SQLite.Interop.dll"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </Content> - <Content Include="x86\SQLite.Interop.dll"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </Content> </ItemGroup> <ItemGroup /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config index 8a94d35ff..c9c7cab8a 100644 --- a/MediaBrowser.Controller/packages.config +++ b/MediaBrowser.Controller/packages.config @@ -6,5 +6,4 @@ <package id="Rx-Core" version="2.0.21114" targetFramework="net45" /> <package id="Rx-Interfaces" version="2.0.21114" targetFramework="net45" /> <package id="Rx-Linq" version="2.0.21114" targetFramework="net45" /> - <package id="System.Data.SQLite" version="1.0.84.0" targetFramework="net45" /> </packages>
\ No newline at end of file diff --git a/MediaBrowser.IsoMounter/MediaBrowser.IsoMounter.csproj b/MediaBrowser.IsoMounter/MediaBrowser.IsoMounter.csproj index 2d2fe5bae..2dd1fa8b6 100644 --- a/MediaBrowser.IsoMounter/MediaBrowser.IsoMounter.csproj +++ b/MediaBrowser.IsoMounter/MediaBrowser.IsoMounter.csproj @@ -62,8 +62,8 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="IsoManager.cs" /> - <Compile Include="IsoMount.cs" /> + <Compile Include="PismoIsoManager.cs" /> + <Compile Include="PismoMount.cs" /> <Compile Include="MyPfmFileMountUi.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> diff --git a/MediaBrowser.IsoMounter/IsoManager.cs b/MediaBrowser.IsoMounter/PismoIsoManager.cs index 22f09addf..b3a1889f0 100644 --- a/MediaBrowser.IsoMounter/IsoManager.cs +++ b/MediaBrowser.IsoMounter/PismoIsoManager.cs @@ -1,17 +1,20 @@ using MediaBrowser.Common.IO; -using MediaBrowser.Common.Kernel; using System; using System.IO; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Logging; +using MediaBrowser.Model.Logging; namespace MediaBrowser.IsoMounter { /// <summary> /// Class IsoManager /// </summary> - public class IsoManager : BaseManager<IKernel>, IIsoManager + public class PismoIsoManager : IIsoManager { + private ILogger Logger = LogManager.GetLogger("IsoManager"); + /// <summary> /// The mount semaphore - limit to four at a time. /// </summary> @@ -66,12 +69,7 @@ namespace MediaBrowser.IsoMounter /// </summary> private bool _hasInitialized; - /// <summary> - /// Initializes a new instance of the <see cref="IsoManager" /> class. - /// </summary> - /// <param name="kernel">The kernel.</param> - public IsoManager(IKernel kernel) - : base(kernel) + public PismoIsoManager() { } @@ -146,14 +144,19 @@ namespace MediaBrowser.IsoMounter throw new IOException("Unable to start mount for " + isoPath); } - return new IsoMount(mount, isoPath, this); + return new PismoMount(mount, isoPath, this); + } + + public void Dispose() + { + Dispose(true); } /// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> - protected override void Dispose(bool dispose) + protected virtual void Dispose(bool dispose) { if (dispose) { @@ -166,8 +169,6 @@ namespace MediaBrowser.IsoMounter PfmStatic.ApiUnload(); } } - - base.Dispose(dispose); } /// <summary> @@ -192,7 +193,7 @@ namespace MediaBrowser.IsoMounter /// Called when [unmount]. /// </summary> /// <param name="mount">The mount.</param> - internal void OnUnmount(IsoMount mount) + internal void OnUnmount(PismoMount mount) { _mountSemaphore.Release(); } diff --git a/MediaBrowser.IsoMounter/IsoMount.cs b/MediaBrowser.IsoMounter/PismoMount.cs index 6524fd234..1e3dbb881 100644 --- a/MediaBrowser.IsoMounter/IsoMount.cs +++ b/MediaBrowser.IsoMounter/PismoMount.cs @@ -8,7 +8,7 @@ namespace MediaBrowser.IsoMounter /// <summary> /// Class IsoMount /// </summary> - internal class IsoMount : IIsoMount + internal class PismoMount : IIsoMount { /// <summary> /// The logger @@ -35,15 +35,15 @@ namespace MediaBrowser.IsoMounter /// <summary> /// The _iso manager /// </summary> - private readonly IsoManager _isoManager; + private readonly PismoIsoManager _isoManager; /// <summary> - /// Prevents a default instance of the <see cref="IsoMount" /> class from being created. + /// Prevents a default instance of the <see cref="PismoMount" /> class from being created. /// </summary> /// <param name="mount">The mount.</param> /// <param name="isoPath">The iso path.</param> /// <param name="isoManager">The iso manager.</param> - internal IsoMount(PfmFileMount mount, string isoPath, IsoManager isoManager) + internal PismoMount(PfmFileMount mount, string isoPath, PismoIsoManager isoManager) { _pfmFileMount = mount; IsoPath = isoPath; diff --git a/MediaBrowser.Model/DTO/BaseItemPerson.cs b/MediaBrowser.Model/DTO/BaseItemPerson.cs index 6bb78541d..442dfa8a4 100644 --- a/MediaBrowser.Model/DTO/BaseItemPerson.cs +++ b/MediaBrowser.Model/DTO/BaseItemPerson.cs @@ -46,7 +46,10 @@ namespace MediaBrowser.Model.DTO [IgnoreDataMember] public bool HasPrimaryImage { - get { return PrimaryImageTag.HasValue; } + get + { + return PrimaryImageTag.HasValue; + } } /// <summary> diff --git a/MediaBrowser.Plugins.DefaultTheme/MediaBrowser.Plugins.DefaultTheme.csproj b/MediaBrowser.Plugins.DefaultTheme/MediaBrowser.Plugins.DefaultTheme.csproj index b915f55c1..0ba40e814 100644 --- a/MediaBrowser.Plugins.DefaultTheme/MediaBrowser.Plugins.DefaultTheme.csproj +++ b/MediaBrowser.Plugins.DefaultTheme/MediaBrowser.Plugins.DefaultTheme.csproj @@ -342,7 +342,7 @@ </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> - <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.UI\" /y</PostBuildEvent> + <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.UI\CorePlugins\" /y</PostBuildEvent> </PropertyGroup> <Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj b/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj new file mode 100644 index 000000000..b4e8dba89 --- /dev/null +++ b/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{8649ED6B-8504-4D00-BFA5-B8C73CC744DB}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaBrowser.Server.Sqlite</RootNamespace> + <AssemblyName>MediaBrowser.Server.Sqlite</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> + <RestorePackages>true</RestorePackages> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <RunPostBuildEvent>Always</RunPostBuildEvent> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.ComponentModel.Composition" /> + <Reference Include="System.Core" /> + <Reference Include="System.Data.SQLite"> + <HintPath>..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.dll</HintPath> + </Reference> + <Reference Include="System.Data.SQLite.Linq"> + <HintPath>..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath> + </Reference> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SQLiteDisplayPreferencesRepository.cs" /> + <Compile Include="SQLiteExtensions.cs" /> + <Compile Include="SQLiteItemRepository.cs" /> + <Compile Include="SQLiteRepository.cs" /> + <Compile Include="SQLiteUserDataRepository.cs" /> + <Compile Include="SQLiteUserRepository.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="x64\SQLite.Interop.dll"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + <Content Include="x86\SQLite.Interop.dll"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj"> + <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project> + <Name>MediaBrowser.Common</Name> + </ProjectReference> + <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj"> + <Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project> + <Name>MediaBrowser.Controller</Name> + </ProjectReference> + <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj"> + <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project> + <Name>MediaBrowser.Model</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <Import Project="$(SolutionDir)\.nuget\nuget.targets" /> + <PropertyGroup> + <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent> + </PropertyGroup> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/MediaBrowser.Server.Sqlite/Properties/AssemblyInfo.cs b/MediaBrowser.Server.Sqlite/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..905af0e8c --- /dev/null +++ b/MediaBrowser.Server.Sqlite/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaBrowser.Server.Sqlite")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaBrowser.Server.Sqlite")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f46c9f4b-24ed-49e1-be19-4b6242dd8382")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteDisplayPreferencesRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs index db1535b34..be45a82dd 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteDisplayPreferencesRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs @@ -1,4 +1,6 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; @@ -8,7 +10,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SQLiteDisplayPreferencesRepository diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteExtensions.cs b/MediaBrowser.Server.Sqlite/SQLiteExtensions.cs index f1ed77492..f9f79a8b7 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteExtensions.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteExtensions.cs @@ -2,7 +2,7 @@ using System.Data; using System.Data.SQLite; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SQLiteExtensions diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteItemRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs index 08527f9c1..c381de85b 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteItemRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs @@ -1,5 +1,7 @@ using MediaBrowser.Common.Serialization; +using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Persistence; using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -8,7 +10,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SQLiteItemRepository diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteRepository.cs index 5cf57541b..b84b336dc 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteRepository.cs @@ -9,7 +9,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SqliteRepository diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs index a027e8475..c9d4db3ba 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteUserDataRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs @@ -1,4 +1,6 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Persistence; using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -7,7 +9,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SQLiteUserDataRepository diff --git a/MediaBrowser.Controller/Persistence/SQLite/SQLiteUserRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs index 9fe5e5624..f300f5177 100644 --- a/MediaBrowser.Controller/Persistence/SQLite/SQLiteUserRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs @@ -1,14 +1,16 @@ -using System.Threading; -using MediaBrowser.Common.Serialization; +using MediaBrowser.Common.Serialization; +using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Persistence; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Data; using System.IO; +using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Controller.Persistence.SQLite +namespace MediaBrowser.Server.Sqlite { /// <summary> /// Class SQLiteUserRepository diff --git a/MediaBrowser.Server.Sqlite/packages.config b/MediaBrowser.Server.Sqlite/packages.config new file mode 100644 index 000000000..106618814 --- /dev/null +++ b/MediaBrowser.Server.Sqlite/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="System.Data.SQLite" version="1.0.84.0" targetFramework="net45" /> +</packages>
\ No newline at end of file diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs index 387ae9577..487b60485 100644 --- a/MediaBrowser.ServerApplication/App.xaml.cs +++ b/MediaBrowser.ServerApplication/App.xaml.cs @@ -76,16 +76,6 @@ namespace MediaBrowser.ServerApplication } /// <summary> - /// Instantiates the iso manager. - /// </summary> - /// <param name="kernel">The kernel.</param> - /// <returns>IIsoManager.</returns> - protected override IIsoManager InstantiateIsoManager(IKernel kernel) - { - return new IsoManager(kernel); - } - - /// <summary> /// Called when [second instance launched]. /// </summary> /// <param name="args">The args.</param> @@ -180,7 +170,7 @@ namespace MediaBrowser.ServerApplication /// <returns>IKernel.</returns> protected override IKernel InstantiateKernel() { - return new Kernel(); + return new Kernel(new PismoIsoManager()); } /// <summary> diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index f7799557e..74e437564 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -320,6 +320,9 @@ <Content Include="CorePlugins\MediaBrowser.ApiInteraction.Javascript.dll"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> + <Content Include="CorePlugins\MediaBrowser.Server.Sqlite.dll"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> <Content Include="CorePlugins\MediaBrowser.WebDashboard.dll"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> diff --git a/MediaBrowser.UI/App.xaml.cs b/MediaBrowser.UI/App.xaml.cs index 7d627e0a9..bae133ab7 100644 --- a/MediaBrowser.UI/App.xaml.cs +++ b/MediaBrowser.UI/App.xaml.cs @@ -244,7 +244,7 @@ namespace MediaBrowser.UI /// <returns>IKernel.</returns> protected override IKernel InstantiateKernel() { - return new UIKernel(); + return new UIKernel(new PismoIsoManager()); } /// <summary> @@ -259,16 +259,6 @@ namespace MediaBrowser.UI } /// <summary> - /// Instantiates the iso manager. - /// </summary> - /// <param name="kernel">The kernel.</param> - /// <returns>IIsoManager.</returns> - protected override IIsoManager InstantiateIsoManager(IKernel kernel) - { - return new IsoManager(kernel); - } - - /// <summary> /// Shows the application window. /// </summary> private void ShowApplicationWindow() @@ -368,7 +358,7 @@ namespace MediaBrowser.UI { var now = DateTime.UtcNow; - await Kernel.Init(InstantiateIsoManager(Kernel)); + await Kernel.Init(); Logger.Info("Kernel.Init completed in {0} seconds.", (DateTime.UtcNow - now).TotalSeconds); diff --git a/MediaBrowser.UI/Controller/UIKernel.cs b/MediaBrowser.UI/Controller/UIKernel.cs index be313e153..2c06e7b93 100644 --- a/MediaBrowser.UI/Controller/UIKernel.cs +++ b/MediaBrowser.UI/Controller/UIKernel.cs @@ -1,7 +1,5 @@ -using System.Net; -using System.Net.Cache; -using System.Net.Http; -using MediaBrowser.ApiInteraction; +using MediaBrowser.ApiInteraction; +using MediaBrowser.Common.IO; using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Logging; using MediaBrowser.Model.Connectivity; @@ -14,6 +12,9 @@ using System.ComponentModel.Composition; using System.Diagnostics; using System.IO; using System.Linq; +using System.Net; +using System.Net.Cache; +using System.Net.Http; using System.Reflection; using System.Threading.Tasks; @@ -45,8 +46,8 @@ namespace MediaBrowser.UI.Controller /// <summary> /// Initializes a new instance of the <see cref="UIKernel" /> class. /// </summary> - public UIKernel() - : base() + public UIKernel(IIsoManager isoManager) + : base(isoManager) { Instance = this; } @@ -148,20 +149,6 @@ namespace MediaBrowser.UI.Controller } /// <summary> - /// Gets the composable part assemblies. - /// </summary> - /// <returns>IEnumerable{Assembly}.</returns> - protected override IEnumerable<Assembly> GetComposablePartAssemblies() - { - var runningDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); - - return base.GetComposablePartAssemblies().Concat(new[] { - - Assembly.Load(File.ReadAllBytes(Path.Combine(runningDirectory, "MediaBrowser.Plugins.DefaultTheme.dll"))) - }); - } - - /// <summary> /// Called when [composable parts loaded]. /// </summary> /// <returns>Task.</returns> diff --git a/MediaBrowser.UI/MediaBrowser.UI.csproj b/MediaBrowser.UI/MediaBrowser.UI.csproj index d2db097aa..8d6432ebb 100644 --- a/MediaBrowser.UI/MediaBrowser.UI.csproj +++ b/MediaBrowser.UI/MediaBrowser.UI.csproj @@ -397,7 +397,7 @@ <Content Include="libvlccore.dll"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> - <Content Include="MediaBrowser.Plugins.DefaultTheme.dll"> + <Content Include="CorePlugins\MediaBrowser.Plugins.DefaultTheme.dll"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="plugins\3dnow\libmemcpy3dn_plugin.dll"> diff --git a/MediaBrowser.sln b/MediaBrowser.sln index 1e9f922a9..9e35fdc9e 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -45,6 +45,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Plugins.Dlna", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Installer", "MediaBrowser.Installer\MediaBrowser.Installer.csproj", "{3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Sqlite", "MediaBrowser.Server.Sqlite\MediaBrowser.Server.Sqlite.csproj", "{8649ED6B-8504-4D00-BFA5-B8C73CC744DB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -287,6 +289,20 @@ Global {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|Win32.ActiveCfg = Release|Any CPU {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|x64.ActiveCfg = Release|Any CPU {3879F78A-D6F6-45E5-B2A8-D8DCF2DABB74}.Release|x86.ActiveCfg = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|x64.ActiveCfg = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Debug|x86.ActiveCfg = Debug|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|Any CPU.Build.0 = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|Win32.ActiveCfg = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|x64.ActiveCfg = Release|Any CPU + {8649ED6B-8504-4D00-BFA5-B8C73CC744DB}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE |
