aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs20
-rw-r--r--MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs5
-rw-r--r--MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj2
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs32
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/Release5767.cs48
5 files changed, 52 insertions, 55 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index aeafc1ede..2f098aad0 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -363,7 +363,7 @@ namespace MediaBrowser.Server.Startup.Common
{
var migrations = new List<IVersionMigration>
{
- new Release5767(ServerConfigurationManager, TaskManager)
+ new DbMigration(ServerConfigurationManager, TaskManager)
};
foreach (var task in migrations)
@@ -465,7 +465,7 @@ namespace MediaBrowser.Server.Startup.Common
ConnectManager = new ConnectManager(LogManager.GetLogger("Connect"), ApplicationPaths, JsonSerializer, encryptionManager, HttpClient, this, ServerConfigurationManager, UserManager, ProviderManager, SecurityManager, FileSystemManager);
RegisterSingleInstance(ConnectManager);
- DeviceManager = new DeviceManager(new DeviceRepository(ApplicationPaths, JsonSerializer, LogManager.GetLogger("DeviceManager"), FileSystemManager), UserManager, FileSystemManager, LibraryMonitor, ConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager);
+ DeviceManager = new DeviceManager(new DeviceRepository(ApplicationPaths, JsonSerializer, LogManager.GetLogger("DeviceManager"), FileSystemManager), UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LogManager.GetLogger("DeviceManager"), NetworkManager);
RegisterSingleInstance(DeviceManager);
var newsService = new Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
@@ -573,7 +573,7 @@ namespace MediaBrowser.Server.Startup.Common
{
try
{
- return new ImageMagickEncoder(LogManager.GetLogger("ImageMagick"), ApplicationPaths, HttpClient, FileSystemManager);
+ return new ImageMagickEncoder(LogManager.GetLogger("ImageMagick"), ApplicationPaths, HttpClient, FileSystemManager, ServerConfigurationManager);
}
catch (Exception ex)
{
@@ -640,11 +640,19 @@ namespace MediaBrowser.Server.Startup.Common
/// <returns>Task{IUserRepository}.</returns>
private async Task<IUserRepository> GetUserRepository()
{
- var repo = new SqliteUserRepository(LogManager, ApplicationPaths, JsonSerializer);
+ try
+ {
+ var repo = new SqliteUserRepository(LogManager, ApplicationPaths, JsonSerializer);
- await repo.Initialize().ConfigureAwait(false);
+ await repo.Initialize().ConfigureAwait(false);
- return repo;
+ return repo;
+ }
+ catch (Exception ex)
+ {
+ Logger.ErrorException("Error opening user db", ex);
+ throw;
+ }
}
/// <summary>
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
index 42fc73488..b4d2e5b85 100644
--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs
@@ -126,6 +126,11 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
{
"https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-2.8.0-32bit-static.7z"
};
+ case Architecture.Arm:
+ return new[]
+ {
+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-arm.7z"
+ };
}
break;
}
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index 13b782e40..b58646a2e 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -72,7 +72,7 @@
<Compile Include="INativeApp.cs" />
<Compile Include="MbLinkShortcutHandler.cs" />
<Compile Include="Migrations\IVersionMigration.cs" />
- <Compile Include="Migrations\Release5767.cs" />
+ <Compile Include="Migrations\DbMigration.cs" />
<Compile Include="Migrations\RenameXmlOptions.cs" />
<Compile Include="NativeEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
new file mode 100644
index 000000000..cdb69025a
--- /dev/null
+++ b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
@@ -0,0 +1,32 @@
+using System.Threading.Tasks;
+using MediaBrowser.Common.ScheduledTasks;
+using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Server.Implementations.Persistence;
+
+namespace MediaBrowser.Server.Startup.Common.Migrations
+{
+ public class DbMigration : IVersionMigration
+ {
+ private readonly IServerConfigurationManager _config;
+ private readonly ITaskManager _taskManager;
+
+ public DbMigration(IServerConfigurationManager config, ITaskManager taskManager)
+ {
+ _config = config;
+ _taskManager = taskManager;
+ }
+
+ public void Run()
+ {
+ if (_config.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion)
+ {
+ Task.Run(async () =>
+ {
+ await Task.Delay(2000).ConfigureAwait(false);
+
+ _taskManager.QueueScheduledTask<CleanDatabaseScheduledTask>();
+ });
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/Release5767.cs b/MediaBrowser.Server.Startup.Common/Migrations/Release5767.cs
deleted file mode 100644
index 168230b87..000000000
--- a/MediaBrowser.Server.Startup.Common/Migrations/Release5767.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-using MediaBrowser.Common.ScheduledTasks;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Server.Implementations.LiveTv;
-using MediaBrowser.Server.Implementations.Persistence;
-using MediaBrowser.Server.Implementations.ScheduledTasks;
-
-namespace MediaBrowser.Server.Startup.Common.Migrations
-{
- public class Release5767 : IVersionMigration
- {
- private readonly IServerConfigurationManager _config;
- private readonly ITaskManager _taskManager;
-
- public Release5767(IServerConfigurationManager config, ITaskManager taskManager)
- {
- _config = config;
- _taskManager = taskManager;
- }
-
- public async void Run()
- {
- var name = "5767.1";
-
- if (_config.Configuration.Migrations.Contains(name, StringComparer.OrdinalIgnoreCase))
- {
- return;
- }
-
- Task.Run(async () =>
- {
- await Task.Delay(3000).ConfigureAwait(false);
-
- _taskManager.QueueScheduledTask<CleanDatabaseScheduledTask>();
- });
-
- // Wait a few minutes before marking this as done. Make sure the server doesn't get restarted.
- await Task.Delay(300000).ConfigureAwait(false);
-
- var list = _config.Configuration.Migrations.ToList();
- list.Add(name);
- _config.Configuration.Migrations = list.ToArray();
- _config.SaveConfiguration();
- }
- }
-}