diff options
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 4ca073c10..434b04eff 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; @@ -98,6 +99,26 @@ namespace MediaBrowser.Api public class LibraryService : BaseRestService { /// <summary> + /// The _app host + /// </summary> + private readonly IApplicationHost _appHost; + + /// <summary> + /// Initializes a new instance of the <see cref="LibraryService" /> class. + /// </summary> + /// <param name="appHost">The app host.</param> + /// <exception cref="System.ArgumentNullException">appHost</exception> + public LibraryService(IApplicationHost appHost) + { + if (appHost == null) + { + throw new ArgumentNullException("appHost"); + } + + _appHost = appHost; + } + + /// <summary> /// Gets the specified request. /// </summary> /// <param name="request">The request.</param> @@ -210,7 +231,7 @@ namespace MediaBrowser.Api { var kernel = (Kernel)Kernel; - var allTypes = kernel.AllTypes.Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(BaseItem))); + var allTypes = _appHost.AllConcreteTypes.Where(t => t.IsSubclassOf(typeof(BaseItem))); if (request.HasInternetProvider) { |
