aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/Native
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.ServerApplication/Native')
-rw-r--r--MediaBrowser.ServerApplication/Native/DbConnector.cs24
-rw-r--r--MediaBrowser.ServerApplication/Native/SqliteExtensions.cs62
-rw-r--r--MediaBrowser.ServerApplication/Native/WindowsApp.cs28
3 files changed, 28 insertions, 86 deletions
diff --git a/MediaBrowser.ServerApplication/Native/DbConnector.cs b/MediaBrowser.ServerApplication/Native/DbConnector.cs
new file mode 100644
index 000000000..9aaa96a80
--- /dev/null
+++ b/MediaBrowser.ServerApplication/Native/DbConnector.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Data;
+using System.Data.SQLite;
+using System.Threading.Tasks;
+using MediaBrowser.Model.Logging;
+using MediaBrowser.Server.Implementations.Persistence;
+
+namespace MediaBrowser.ServerApplication.Native
+{
+ public class DbConnector : IDbConnector
+ {
+ private readonly ILogger _logger;
+
+ public DbConnector(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public Task<IDbConnection> Connect(string dbPath, bool isReadOnly, bool enablePooling = false, int? cacheSize = null)
+ {
+ return SqliteExtensions.ConnectToDb(dbPath, isReadOnly, enablePooling, cacheSize, _logger);
+ }
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.ServerApplication/Native/SqliteExtensions.cs b/MediaBrowser.ServerApplication/Native/SqliteExtensions.cs
deleted file mode 100644
index 1cde2ea13..000000000
--- a/MediaBrowser.ServerApplication/Native/SqliteExtensions.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-using System.Data;
-using System.Data.SQLite;
-using System.Threading.Tasks;
-using MediaBrowser.Model.Logging;
-using MediaBrowser.Server.Implementations.Persistence;
-
-namespace MediaBrowser.ServerApplication.Native
-{
- /// <summary>
- /// Class SQLiteExtensions
- /// </summary>
- static class SqliteExtensions
- {
- /// <summary>
- /// Connects to db.
- /// </summary>
- /// <param name="dbPath">The db path.</param>
- /// <param name="logger">The logger.</param>
- /// <returns>Task{IDbConnection}.</returns>
- /// <exception cref="System.ArgumentNullException">dbPath</exception>
- public static async Task<IDbConnection> ConnectToDb(string dbPath, ILogger logger)
- {
- if (string.IsNullOrEmpty(dbPath))
- {
- throw new ArgumentNullException("dbPath");
- }
-
- logger.Info("Sqlite {0} opening {1}", SQLiteConnection.SQLiteVersion, dbPath);
-
- var connectionstr = new SQLiteConnectionStringBuilder
- {
- PageSize = 4096,
- CacheSize = 2000,
- SyncMode = SynchronizationModes.Full,
- DataSource = dbPath,
- JournalMode = SQLiteJournalModeEnum.Wal
- };
-
- var connection = new SQLiteConnection(connectionstr.ConnectionString);
-
- await connection.OpenAsync().ConfigureAwait(false);
-
- return connection;
- }
- }
-
- public class DbConnector : IDbConnector
- {
- private readonly ILogger _logger;
-
- public DbConnector(ILogger logger)
- {
- _logger = logger;
- }
-
- public Task<IDbConnection> Connect(string dbPath)
- {
- return SqliteExtensions.ConnectToDb(dbPath, _logger);
- }
- }
-} \ No newline at end of file
diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs
index c99b0f9af..d8b2720c2 100644
--- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs
+++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs
@@ -10,6 +10,7 @@ using System.Reflection;
using System.Windows.Forms;
using CommonIO;
using MediaBrowser.Controller.Power;
+using MediaBrowser.Model.System;
using MediaBrowser.Server.Implementations.Persistence;
using MediaBrowser.Server.Startup.Common.FFMpeg;
using OperatingSystem = MediaBrowser.Server.Startup.Common.OperatingSystem;
@@ -53,7 +54,7 @@ namespace MediaBrowser.ServerApplication.Native
return new NativeEnvironment
{
OperatingSystem = OperatingSystem.Windows,
- SystemArchitecture = System.Environment.Is64BitOperatingSystem ? Architecture.X86_X64 : Architecture.X86,
+ SystemArchitecture = System.Environment.Is64BitOperatingSystem ? Architecture.X64 : Architecture.X86,
OperatingSystemVersionString = System.Environment.OSVersion.VersionString
};
}
@@ -158,10 +159,7 @@ namespace MediaBrowser.ServerApplication.Native
info.FFMpegFilename = "ffmpeg.exe";
info.FFProbeFilename = "ffprobe.exe";
- info.Version = "20160410";
- info.ArchiveType = "7z";
- info.IsEmbedded = false;
- info.DownloadUrls = GetDownloadUrls();
+ info.Version = "0";
return info;
}
@@ -206,23 +204,5 @@ namespace MediaBrowser.ServerApplication.Native
{
((Process)sender).Dispose();
}
-
- private string[] GetDownloadUrls()
- {
- switch (Environment.SystemArchitecture)
- {
- case Architecture.X86_X64:
- return new[]
- {
- "https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20160409-git-0c90b2e-win64-static.7z"
- };
- case Architecture.X86:
- return new[]
- {
- "https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20160409-git-0c90b2e-win32-static.7z"
- };
- }
- return new string[] { };
- }
}
-}
+} \ No newline at end of file