aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2014-12-14 00:38:07 -0500
committerLuke <luke.pulverenti@gmail.com>2014-12-14 00:38:07 -0500
commit524293ea79ab61228f8326561be70bcca4d0ea8f (patch)
treeccfe163c8edafc8dd14b0b63d48712a6d504de9d /MediaBrowser.Server.Startup.Common
parent00da34b90a2f2fcee4d6aa584e25fccebb375b6d (diff)
parent9df9723fa8554df0fd51d777d3f781b0136de926 (diff)
Merge pull request #954 from MediaBrowser/dev
3.0.5462.0
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs18
-rw-r--r--MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj1
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs42
3 files changed, 50 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index 7360f1915d..1d69cd3252 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -346,6 +346,7 @@ namespace MediaBrowser.Server.Startup.Common
new RenameXbmcOptions(ServerConfigurationManager).Run();
new RenameXmlOptions(ServerConfigurationManager).Run();
new DeprecatePlugins(ApplicationPaths).Run();
+ new DeleteDlnaProfiles(ApplicationPaths).Run();
}
/// <summary>
@@ -389,8 +390,8 @@ namespace MediaBrowser.Server.Startup.Common
AuthenticationRepository = await GetAuthenticationRepository().ConfigureAwait(false);
RegisterSingleInstance(AuthenticationRepository);
- //SyncRepository = await GetSyncRepository().ConfigureAwait(false);
- //RegisterSingleInstance(SyncRepository);
+ SyncRepository = await GetSyncRepository().ConfigureAwait(false);
+ RegisterSingleInstance(SyncRepository);
UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, () => ConnectManager, this);
RegisterSingleInstance(UserManager);
@@ -428,7 +429,7 @@ namespace MediaBrowser.Server.Startup.Common
ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, MediaEncoder);
RegisterSingleInstance(ImageProcessor);
- SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"));
+ SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"), UserManager);
RegisterSingleInstance(SyncManager);
DtoService = new DtoService(Logger, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager, this);
@@ -446,7 +447,7 @@ namespace MediaBrowser.Server.Startup.Common
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, ItemRepository, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager);
RegisterSingleInstance(SessionManager);
- var newsService = new Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
+ var newsService = new Implementations.News.NewsService(ApplicationPaths, JsonSerializer);
RegisterSingleInstance<INewsService>(newsService);
var fileOrganizationService = new FileOrganizationService(TaskManager, FileOrganizationRepository, LogManager.GetLogger("FileOrganizationService"), LibraryMonitor, LibraryManager, ServerConfigurationManager, FileSystemManager, ProviderManager);
@@ -481,7 +482,7 @@ namespace MediaBrowser.Server.Startup.Common
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, FileSystemManager, UserManager, ChannelManager, LiveTvManager, ApplicationPaths, playlistManager);
RegisterSingleInstance(UserViewManager);
- var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager);
+ var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager);
RegisterSingleInstance<IContentDirectory>(contentDirectory);
NotificationManager = new NotificationManager(LogManager, UserManager, ServerConfigurationManager);
@@ -950,11 +951,6 @@ namespace MediaBrowser.Server.Startup.Common
var localAddresses = NetworkManager.GetLocalIpAddresses()
.ToList();
- if (localAddresses.Count < 2)
- {
- return localAddresses;
- }
-
var httpServerAddresses = HttpServer.LocalEndPoints
.Select(i => i.Split(':').FirstOrDefault())
.Where(i => !string.IsNullOrEmpty(i))
@@ -967,7 +963,7 @@ namespace MediaBrowser.Server.Startup.Common
if (matchedAddresses.Count == 0)
{
- return localAddresses.Take(1);
+ return localAddresses;
}
return matchedAddresses;
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index db525e8e45..b133f78e74 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -63,6 +63,7 @@
<Compile Include="FFMpeg\FFMpegInfo.cs" />
<Compile Include="FFMpeg\FFmpegValidator.cs" />
<Compile Include="INativeApp.cs" />
+ <Compile Include="Migrations\DeleteDlnaProfiles.cs" />
<Compile Include="Migrations\DeprecatePlugins.cs" />
<Compile Include="Migrations\IVersionMigration.cs" />
<Compile Include="Migrations\MigrateUserFolders.cs" />
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs
new file mode 100644
index 0000000000..8fe841ffce
--- /dev/null
+++ b/MediaBrowser.Server.Startup.Common/Migrations/DeleteDlnaProfiles.cs
@@ -0,0 +1,42 @@
+using MediaBrowser.Controller;
+using System.IO;
+
+namespace MediaBrowser.Server.Startup.Common.Migrations
+{
+ public class DeleteDlnaProfiles : IVersionMigration
+ {
+ private readonly IServerApplicationPaths _appPaths;
+
+ public DeleteDlnaProfiles(IServerApplicationPaths appPaths)
+ {
+ _appPaths = appPaths;
+ }
+
+ public void Run()
+ {
+ RemoveProfile("Android");
+ RemoveProfile("Windows Phone");
+ RemoveProfile("Windows 8 RT");
+ }
+
+ private void RemoveProfile(string filename)
+ {
+ try
+ {
+ File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system", filename + ".xml"));
+ }
+ catch
+ {
+
+ }
+ try
+ {
+ File.Delete(Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user", filename + ".xml"));
+ }
+ catch
+ {
+
+ }
+ }
+ }
+}