From 53d0e5286077aca06ab73e9d2ff218eec52c6eb1 Mon Sep 17 00:00:00 2001 From: Sumit Maitra Date: Sat, 5 Oct 2013 03:10:54 +0100 Subject: [PATCH 1/2] First successful Mono build on OSX --- ...MediaBrowser.Server.Implementations.csproj | 14 +++++--- .../Persistence/SqliteExtensions.cs | 18 +++++++++- .../packages.config | 33 ++++++++++--------- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 86ea3b051..39a9b7789 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -37,10 +37,6 @@ ..\packages\Alchemy.2.2.1\lib\net40\Alchemy.dll - - False - ..\packages\ServiceStack.OrmLite.Sqlite32.3.9.63\lib\net40\ServiceStack.OrmLite.dll - ..\packages\ServiceStack.OrmLite.Sqlite32.3.9.63\lib\net40\ServiceStack.OrmLite.SqliteNET.dll @@ -97,6 +93,15 @@ ..\packages\System.Data.SQLite.x86.1.0.88.0\lib\net45\System.Data.SQLite.Linq.dll + + ..\packages\ServiceStack.OrmLite.Sqlite.Mono.3.9.64\lib\net35\Mono.Data.Sqlite.dll + + + ..\packages\ServiceStack.OrmLite.Sqlite.Mono.3.9.64\lib\net35\ServiceStack.OrmLite.dll + + + ..\packages\ServiceStack.OrmLite.Sqlite.Mono.3.9.64\lib\net35\ServiceStack.OrmLite.Sqlite.dll + @@ -253,6 +258,7 @@ + diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs index 41e419e1a..b5672c39b 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs @@ -1,7 +1,11 @@ using MediaBrowser.Model.Logging; using System; using System.Data; +#if __MonoCS__ +using Mono.Data.Sqlite; +#else using System.Data.SQLite; +#endif using System.IO; using System.Threading.Tasks; @@ -133,6 +137,18 @@ namespace MediaBrowser.Server.Implementations.Persistence throw new ArgumentNullException("dbPath"); } + #if __MonoCS__ + var connectionstr = new SqliteConnectionStringBuilder + { + PageSize = 4096, + CacheSize = 4096, + SyncMode = SynchronizationModes.Normal, + DataSource = dbPath, + JournalMode = SQLiteJournalModeEnum.Off + }; + + var connection = new SqliteConnection(connectionstr.ConnectionString); +#else var connectionstr = new SQLiteConnectionStringBuilder { PageSize = 4096, @@ -143,7 +159,7 @@ namespace MediaBrowser.Server.Implementations.Persistence }; var connection = new SQLiteConnection(connectionstr.ConnectionString); - +#endif await connection.OpenAsync().ConfigureAwait(false); return connection; diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 6dfb01cc0..bdcf0f9ff 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -1,17 +1,18 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file From d72e68f0cd4a17388b1d4b31adad14acecb96344 Mon Sep 17 00:00:00 2001 From: Sumit Maitra Date: Sat, 5 Oct 2013 03:58:13 +0100 Subject: [PATCH 2/2] Fix to ensure correct URLs on OSX --- MediaBrowser.WebDashboard/Api/DashboardService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 5cf0f2efa..5ebeaf24a 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -161,7 +161,11 @@ namespace MediaBrowser.WebDashboard.Api /// System.String. private string GetDashboardResourcePath(string virtualPath) { - return Path.Combine(DashboardUIPath, virtualPath.Replace('/', '\\')); + #if __MonoCS__ + return Path.Combine(DashboardUIPath, virtualPath); + #else + return Path.Combine(DashboardUIPath, virtualPath.Replace('/', '\\')); + #endif } ///