aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-03-07 18:10:55 +0100
committerBond-009 <bond.009@outlook.com>2019-03-07 18:10:55 +0100
commite91dd14b3167e3fcf12e24b4664d4d18cdad7d26 (patch)
tree5ad850357ad094343d5071a4296cc60ac2a67b7a /Emby.Server.Implementations
parent8a53b609127cca6feee06b34f12b6d21a9eb37c7 (diff)
Remove redundent class AssemblyInfo
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs7
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs6
-rw-r--r--Emby.Server.Implementations/Data/TypeMapper.cs9
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs4
-rw-r--r--Emby.Server.Implementations/Reflection/AssemblyInfo.cs25
5 files changed, 5 insertions, 46 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index dc971ea59..eb83ec1fb 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -36,7 +36,6 @@ using Emby.Server.Implementations.LiveTv;
using Emby.Server.Implementations.Localization;
using Emby.Server.Implementations.Net;
using Emby.Server.Implementations.Playlists;
-using Emby.Server.Implementations.Reflection;
using Emby.Server.Implementations.ScheduledTasks;
using Emby.Server.Implementations.Security;
using Emby.Server.Implementations.Serialization;
@@ -91,7 +90,6 @@ using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Net;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
using MediaBrowser.Model.System;
@@ -681,9 +679,6 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton(ServerConfigurationManager);
- var assemblyInfo = new AssemblyInfo();
- serviceCollection.AddSingleton<IAssemblyInfo>(assemblyInfo);
-
LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LoggerFactory);
await LocalizationManager.LoadAll();
serviceCollection.AddSingleton<ILocalizationManager>(LocalizationManager);
@@ -702,7 +697,7 @@ namespace Emby.Server.Implementations
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory, JsonSerializer, ApplicationPaths, FileSystemManager);
serviceCollection.AddSingleton<IDisplayPreferencesRepository>(displayPreferencesRepo);
- ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, assemblyInfo);
+ ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory);
serviceCollection.AddSingleton<IItemRepository>(ItemRepository);
AuthenticationRepository = GetAuthenticationRepository();
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 06f6563a3..3ae63279b 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -24,7 +24,6 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Querying;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
using SQLitePCL.pretty;
@@ -65,8 +64,7 @@ namespace Emby.Server.Implementations.Data
IServerConfigurationManager config,
IServerApplicationHost appHost,
IJsonSerializer jsonSerializer,
- ILoggerFactory loggerFactory,
- IAssemblyInfo assemblyInfo)
+ ILoggerFactory loggerFactory)
: base(loggerFactory.CreateLogger(nameof(SqliteItemRepository)))
{
if (config == null)
@@ -82,7 +80,7 @@ namespace Emby.Server.Implementations.Data
_appHost = appHost;
_config = config;
_jsonSerializer = jsonSerializer;
- _typeMapper = new TypeMapper(assemblyInfo);
+ _typeMapper = new TypeMapper();
DbFilePath = Path.Combine(_config.ApplicationPaths.DataPath, "library.db");
}
diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.cs
index 37c952e88..0e67affbf 100644
--- a/Emby.Server.Implementations/Data/TypeMapper.cs
+++ b/Emby.Server.Implementations/Data/TypeMapper.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Linq;
-using MediaBrowser.Model.Reflection;
namespace Emby.Server.Implementations.Data
{
@@ -10,16 +9,13 @@ namespace Emby.Server.Implementations.Data
/// </summary>
public class TypeMapper
{
- private readonly IAssemblyInfo _assemblyInfo;
-
/// <summary>
/// This holds all the types in the running assemblies so that we can de-serialize properly when we don't have strong types
/// </summary>
private readonly ConcurrentDictionary<string, Type> _typeMap = new ConcurrentDictionary<string, Type>();
- public TypeMapper(IAssemblyInfo assemblyInfo)
+ public TypeMapper()
{
- _assemblyInfo = assemblyInfo;
}
/// <summary>
@@ -45,8 +41,7 @@ namespace Emby.Server.Implementations.Data
/// <returns>Type.</returns>
private Type LookupType(string typeName)
{
- return _assemblyInfo
- .GetCurrentAssemblies()
+ return AppDomain.CurrentDomain.GetAssemblies()
.Select(a => a.GetType(typeName))
.FirstOrDefault(t => t != null);
}
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index fceb82ba1..f4eddb08b 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -33,7 +33,6 @@ using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Querying;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
@@ -58,7 +57,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private readonly IProviderManager _providerManager;
private readonly IMediaEncoder _mediaEncoder;
private readonly IProcessFactory _processFactory;
- private readonly IAssemblyInfo _assemblyInfo;
private IMediaSourceManager _mediaSourceManager;
public static EmbyTV Current;
@@ -74,7 +72,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public EmbyTV(IServerApplicationHost appHost,
IStreamHelper streamHelper,
IMediaSourceManager mediaSourceManager,
- IAssemblyInfo assemblyInfo,
ILogger logger,
IJsonSerializer jsonSerializer,
IHttpClient httpClient,
@@ -101,7 +98,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_processFactory = processFactory;
_liveTvManager = (LiveTvManager)liveTvManager;
_jsonSerializer = jsonSerializer;
- _assemblyInfo = assemblyInfo;
_mediaSourceManager = mediaSourceManager;
_streamHelper = streamHelper;
diff --git a/Emby.Server.Implementations/Reflection/AssemblyInfo.cs b/Emby.Server.Implementations/Reflection/AssemblyInfo.cs
deleted file mode 100644
index 9d16fe43f..000000000
--- a/Emby.Server.Implementations/Reflection/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-using MediaBrowser.Model.Reflection;
-
-namespace Emby.Server.Implementations.Reflection
-{
- public class AssemblyInfo : IAssemblyInfo
- {
- public Stream GetManifestResourceStream(Type type, string resource)
- {
- return type.Assembly.GetManifestResourceStream(resource);
- }
-
- public string[] GetManifestResourceNames(Type type)
- {
- return type.Assembly.GetManifestResourceNames();
- }
-
- public Assembly[] GetCurrentAssemblies()
- {
- return AppDomain.CurrentDomain.GetAssemblies();
- }
- }
-}