aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-20 19:58:37 -0500
committerGitHub <noreply@github.com>2016-11-20 19:58:37 -0500
commitb91ebfae1b0a72d3b643221c48932bc45b2612b1 (patch)
treef909f0436c4c8cd571084df18cdc7efb5a6ba922 /src
parenta6ded79ea7d9d4cc9ed8d28b7043aa18c8ec02ae (diff)
parent985c9111cf14431c3e1a1f94953a6d4422d167ee (diff)
Merge pull request #2298 from MediaBrowser/dev
Dev
Diffstat (limited to 'src')
-rw-r--r--src/Emby.Server/CoreAppHost.cs50
-rw-r--r--src/Emby.Server/Data/DbConnector.cs52
-rw-r--r--src/Emby.Server/Program.cs41
-rw-r--r--src/Emby.Server/project.json7
4 files changed, 72 insertions, 78 deletions
diff --git a/src/Emby.Server/CoreAppHost.cs b/src/Emby.Server/CoreAppHost.cs
index 21f6ae445..09df664fa 100644
--- a/src/Emby.Server/CoreAppHost.cs
+++ b/src/Emby.Server/CoreAppHost.cs
@@ -4,12 +4,11 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Emby.Server.Core;
-using Emby.Server.Core.Data;
-using Emby.Server.Core.FFMpeg;
-using Emby.Server.Data;
+using Emby.Server.Implementations.FFMpeg;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.System;
+using Emby.Server.Implementations;
namespace Emby.Server
{
@@ -39,9 +38,37 @@ namespace Emby.Server
{
var info = new FFMpegInstallInfo();
+ if (EnvironmentInfo.OperatingSystem == OperatingSystem.Windows)
+ {
+ info.FFMpegFilename = "ffmpeg.exe";
+ info.FFProbeFilename = "ffprobe.exe";
+ info.Version = "20160410";
+ info.ArchiveType = "7z";
+ info.DownloadUrls = GetDownloadUrls();
+ }
+
return info;
}
+ private string[] GetDownloadUrls()
+ {
+ switch (EnvironmentInfo.SystemArchitecture)
+ {
+ case Architecture.X64:
+ return new[]
+ {
+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win64.7z"
+ };
+ case Architecture.X86:
+ return new[]
+ {
+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win32.7z"
+ };
+ }
+
+ return new string[] { };
+ }
+
protected override List<Assembly> GetAssembliesWithPartsInternal()
{
var list = new List<Assembly>();
@@ -55,19 +82,10 @@ namespace Emby.Server
{
}
- protected override IDbConnector GetDbConnector()
- {
- return new DbConnector(Logger);
- }
-
protected override void ConfigureAutoRunInternal(bool autorun)
{
}
- public override void LaunchUrl(string url)
- {
- }
-
protected override void EnableLoopbackInternal(string appName)
{
}
@@ -103,5 +121,13 @@ namespace Emby.Server
return Program.CanSelfUpdate;
}
}
+
+ protected override bool SupportsDualModeSockets
+ {
+ get
+ {
+ return true;
+ }
+ }
}
}
diff --git a/src/Emby.Server/Data/DbConnector.cs b/src/Emby.Server/Data/DbConnector.cs
deleted file mode 100644
index bd70cff6c..000000000
--- a/src/Emby.Server/Data/DbConnector.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using System.Data;
-using System.Threading.Tasks;
-using MediaBrowser.Model.Logging;
-using Emby.Server.Core.Data;
-using Microsoft.Data.Sqlite;
-
-namespace Emby.Server.Data
-{
- public class DbConnector : IDbConnector
- {
- private readonly ILogger _logger;
-
- public DbConnector(ILogger logger)
- {
- _logger = logger;
- }
-
- public async Task<IDbConnection> Connect(string dbPath, bool isReadOnly, bool enablePooling = false, int? cacheSize = null)
- {
- if (string.IsNullOrEmpty(dbPath))
- {
- throw new ArgumentNullException("dbPath");
- }
-
- //SQLiteConnection.SetMemoryStatus(false);
-
- var connectionstr = new SqliteConnectionStringBuilder
- {
- //PageSize = 4096,
- //CacheSize = cacheSize ?? 2000,
- //SyncMode = SynchronizationModes.Normal,
- DataSource = dbPath,
- //JournalMode = SQLiteJournalModeEnum.Wal,
-
- // This is causing crashing under linux
- //Pooling = enablePooling && Environment.OSVersion.Platform == PlatformID.Win32NT,
- //ReadOnly = isReadOnly,
- Cache = enablePooling ? SqliteCacheMode.Default : SqliteCacheMode.Private,
- Mode = isReadOnly ? SqliteOpenMode.ReadOnly : SqliteOpenMode.ReadWriteCreate
- };
-
- var connectionString = connectionstr.ConnectionString;
-
- var connection = new SqliteConnection(connectionString);
-
- await connection.OpenAsync().ConfigureAwait(false);
-
- return connection;
- }
- }
-} \ No newline at end of file
diff --git a/src/Emby.Server/Program.cs b/src/Emby.Server/Program.cs
index 80e56c8ab..24e391c73 100644
--- a/src/Emby.Server/Program.cs
+++ b/src/Emby.Server/Program.cs
@@ -15,10 +15,11 @@ using Emby.Common.Implementations.Logging;
using Emby.Common.Implementations.Networking;
using Emby.Drawing;
using Emby.Server.Core;
-using Emby.Server.Core.Browser;
+using Emby.Server.Implementations.Browser;
using Emby.Server.Implementations.IO;
using MediaBrowser.Common.Net;
using Emby.Server.IO;
+using Emby.Server.Implementations;
namespace Emby.Server
{
@@ -38,19 +39,34 @@ namespace Emby.Server
/// </summary>
public static void Main(string[] args)
{
- var options = new StartupOptions();
+ var options = new StartupOptions(Environment.GetCommandLineArgs());
+
+ var environmentInfo = new EnvironmentInfo();
- var currentProcess = Process.GetCurrentProcess();
-
var baseDirectory = System.AppContext.BaseDirectory;
- //var architecturePath = Path.Combine(Path.GetDirectoryName(applicationPath), Environment.Is64BitProcess ? "x64" : "x86");
+ string archPath = baseDirectory;
+ if (environmentInfo.SystemArchitecture == MediaBrowser.Model.System.Architecture.X64)
+ {
+ archPath = Path.Combine(archPath, "x64");
+ }
+ else if (environmentInfo.SystemArchitecture == MediaBrowser.Model.System.Architecture.X86)
+ {
+ archPath = Path.Combine(archPath, "x86");
+ }
+ else
+ {
+ archPath = Path.Combine(archPath, "arm");
+ }
//Wand.SetMagickCoderModulePath(architecturePath);
- //var success = SetDllDirectory(architecturePath);
+ if (environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows)
+ {
+ SetDllDirectory(archPath);
+ }
var appPaths = CreateApplicationPaths(baseDirectory);
- SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
+ SetSqliteProvider();
var logManager = new NlogManager(appPaths.LogDirectoryPath, "server");
logManager.ReloadLogger(LogSeverity.Debug);
@@ -74,7 +90,12 @@ namespace Emby.Server
return;
}
- RunApplication(appPaths, logManager, options);
+ RunApplication(appPaths, logManager, options, environmentInfo);
+ }
+
+ private static void SetSqliteProvider()
+ {
+ SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
}
/// <summary>
@@ -170,7 +191,7 @@ namespace Emby.Server
/// <param name="appPaths">The app paths.</param>
/// <param name="logManager">The log manager.</param>
/// <param name="options">The options.</param>
- private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options)
+ private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options, EnvironmentInfo environmentInfo)
{
var fileSystem = new ManagedFileSystem(logManager.GetLogger("FileSystem"), true, true, true);
@@ -184,7 +205,7 @@ namespace Emby.Server
fileSystem,
new PowerManagement(),
"emby.windows.zip",
- new EnvironmentInfo(),
+ environmentInfo,
imageEncoder,
new CoreSystemEvents(),
new MemoryStreamFactory(),
diff --git a/src/Emby.Server/project.json b/src/Emby.Server/project.json
index 170523db1..35ebdc213 100644
--- a/src/Emby.Server/project.json
+++ b/src/Emby.Server/project.json
@@ -9,18 +9,17 @@
"Emby.Server.Core": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
- "version": "1.0.1"
+ "version": "1.1.0"
},
"Mono.Nat": "1.0.0-*",
"Microsoft.Win32.Registry": "4.0.0",
"System.Runtime.Extensions": "4.1.0",
"System.Diagnostics.Process": "4.1.0",
- "Microsoft.Data.SQLite": "1.1.0-preview1-final",
- "SQLitePCLRaw.provider.sqlite3.netstandard11": "1.1.0"
+ "SQLitePCLRaw.provider.sqlite3.netstandard11": "1.1.1-pre20161109081005"
},
"frameworks": {
- "netcoreapp1.0": {
+ "netcoreapp1.1": {
"imports": "dnxcore50",
"dependencies": {
"BDInfo": {