Kernel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. using MediaBrowser.Common.IO;
  2. using MediaBrowser.Common.Kernel;
  3. using MediaBrowser.Common.Localization;
  4. using MediaBrowser.Common.Plugins;
  5. using MediaBrowser.Controller.Drawing;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Controller.IO;
  8. using MediaBrowser.Controller.Library;
  9. using MediaBrowser.Controller.Localization;
  10. using MediaBrowser.Controller.MediaInfo;
  11. using MediaBrowser.Controller.Persistence;
  12. using MediaBrowser.Controller.Playback;
  13. using MediaBrowser.Controller.Plugins;
  14. using MediaBrowser.Controller.Providers;
  15. using MediaBrowser.Controller.Resolvers;
  16. using MediaBrowser.Controller.ScheduledTasks;
  17. using MediaBrowser.Controller.Updates;
  18. using MediaBrowser.Controller.Weather;
  19. using MediaBrowser.Model.Configuration;
  20. using MediaBrowser.Model.IO;
  21. using MediaBrowser.Model.Logging;
  22. using MediaBrowser.Model.MediaInfo;
  23. using MediaBrowser.Model.System;
  24. using System;
  25. using System.Collections.Generic;
  26. using System.ComponentModel.Composition;
  27. using System.ComponentModel.Composition.Hosting;
  28. using System.Linq;
  29. using System.Threading;
  30. using System.Threading.Tasks;
  31. using SimpleInjector;
  32. namespace MediaBrowser.Controller
  33. {
  34. /// <summary>
  35. /// Class Kernel
  36. /// </summary>
  37. public class Kernel : BaseKernel<ServerConfiguration, ServerApplicationPaths>
  38. {
  39. /// <summary>
  40. /// The MB admin URL
  41. /// </summary>
  42. public const string MBAdminUrl = "http://mb3admin.com/admin/";
  43. /// <summary>
  44. /// Gets the instance.
  45. /// </summary>
  46. /// <value>The instance.</value>
  47. public static Kernel Instance { get; private set; }
  48. /// <summary>
  49. /// Gets the library manager.
  50. /// </summary>
  51. /// <value>The library manager.</value>
  52. public LibraryManager LibraryManager { get; private set; }
  53. /// <summary>
  54. /// Gets the image manager.
  55. /// </summary>
  56. /// <value>The image manager.</value>
  57. public ImageManager ImageManager { get; private set; }
  58. /// <summary>
  59. /// Gets the user manager.
  60. /// </summary>
  61. /// <value>The user manager.</value>
  62. public UserManager UserManager { get; private set; }
  63. /// <summary>
  64. /// Gets the FFMPEG controller.
  65. /// </summary>
  66. /// <value>The FFMPEG controller.</value>
  67. public FFMpegManager FFMpegManager { get; private set; }
  68. /// <summary>
  69. /// Gets the installation manager.
  70. /// </summary>
  71. /// <value>The installation manager.</value>
  72. public InstallationManager InstallationManager { get; private set; }
  73. /// <summary>
  74. /// Gets or sets the file system manager.
  75. /// </summary>
  76. /// <value>The file system manager.</value>
  77. public FileSystemManager FileSystemManager { get; private set; }
  78. /// <summary>
  79. /// Gets the provider manager.
  80. /// </summary>
  81. /// <value>The provider manager.</value>
  82. public ProviderManager ProviderManager { get; private set; }
  83. /// <summary>
  84. /// Gets the user data manager.
  85. /// </summary>
  86. /// <value>The user data manager.</value>
  87. public UserDataManager UserDataManager { get; private set; }
  88. /// <summary>
  89. /// Gets the plug-in security manager.
  90. /// </summary>
  91. /// <value>The plug-in security manager.</value>
  92. public PluginSecurityManager PluginSecurityManager { get; private set; }
  93. /// <summary>
  94. /// The _users
  95. /// </summary>
  96. private IEnumerable<User> _users;
  97. /// <summary>
  98. /// The _user lock
  99. /// </summary>
  100. private object _usersSyncLock = new object();
  101. /// <summary>
  102. /// The _users initialized
  103. /// </summary>
  104. private bool _usersInitialized;
  105. /// <summary>
  106. /// Gets the users.
  107. /// </summary>
  108. /// <value>The users.</value>
  109. public IEnumerable<User> Users
  110. {
  111. get
  112. {
  113. // Call ToList to exhaust the stream because we'll be iterating over this multiple times
  114. LazyInitializer.EnsureInitialized(ref _users, ref _usersInitialized, ref _usersSyncLock, UserManager.LoadUsers);
  115. return _users;
  116. }
  117. internal set
  118. {
  119. _users = value;
  120. if (value == null)
  121. {
  122. _usersInitialized = false;
  123. }
  124. }
  125. }
  126. /// <summary>
  127. /// The _root folder
  128. /// </summary>
  129. private AggregateFolder _rootFolder;
  130. /// <summary>
  131. /// The _root folder sync lock
  132. /// </summary>
  133. private object _rootFolderSyncLock = new object();
  134. /// <summary>
  135. /// The _root folder initialized
  136. /// </summary>
  137. private bool _rootFolderInitialized;
  138. /// <summary>
  139. /// Gets the root folder.
  140. /// </summary>
  141. /// <value>The root folder.</value>
  142. public AggregateFolder RootFolder
  143. {
  144. get
  145. {
  146. LazyInitializer.EnsureInitialized(ref _rootFolder, ref _rootFolderInitialized, ref _rootFolderSyncLock, LibraryManager.CreateRootFolder);
  147. return _rootFolder;
  148. }
  149. private set
  150. {
  151. _rootFolder = value;
  152. if (value == null)
  153. {
  154. _rootFolderInitialized = false;
  155. }
  156. }
  157. }
  158. /// <summary>
  159. /// Gets the kernel context.
  160. /// </summary>
  161. /// <value>The kernel context.</value>
  162. public override KernelContext KernelContext
  163. {
  164. get { return KernelContext.Server; }
  165. }
  166. /// <summary>
  167. /// Gets the list of Localized string files
  168. /// </summary>
  169. /// <value>The string files.</value>
  170. [ImportMany(typeof(LocalizedStringData))]
  171. public IEnumerable<LocalizedStringData> StringFiles { get; private set; }
  172. /// <summary>
  173. /// Gets the list of plugin configuration pages
  174. /// </summary>
  175. /// <value>The configuration pages.</value>
  176. public IEnumerable<IPluginConfigurationPage> PluginConfigurationPages { get; private set; }
  177. /// <summary>
  178. /// Gets the intro providers.
  179. /// </summary>
  180. /// <value>The intro providers.</value>
  181. public IEnumerable<IIntroProvider> IntroProviders { get; private set; }
  182. /// <summary>
  183. /// Gets the list of currently registered weather prvoiders
  184. /// </summary>
  185. /// <value>The weather providers.</value>
  186. public IEnumerable<IWeatherProvider> WeatherProviders { get; private set; }
  187. /// <summary>
  188. /// Gets the list of currently registered metadata prvoiders
  189. /// </summary>
  190. /// <value>The metadata providers enumerable.</value>
  191. [ImportMany(typeof(BaseMetadataProvider))]
  192. public BaseMetadataProvider[] MetadataProviders { get; private set; }
  193. /// <summary>
  194. /// Gets the list of currently registered image processors
  195. /// Image processors are specialized metadata providers that run after the normal ones
  196. /// </summary>
  197. /// <value>The image enhancers.</value>
  198. public IEnumerable<IImageEnhancer> ImageEnhancers { get; private set; }
  199. /// <summary>
  200. /// Gets the list of currently registered entity resolvers
  201. /// </summary>
  202. /// <value>The entity resolvers enumerable.</value>
  203. [ImportMany(typeof(IBaseItemResolver))]
  204. internal IBaseItemResolver[] EntityResolvers { get; private set; }
  205. /// <summary>
  206. /// Gets the list of BasePluginFolders added by plugins
  207. /// </summary>
  208. /// <value>The plugin folders.</value>
  209. [ImportMany(typeof(BasePluginFolder))]
  210. internal IEnumerable<BasePluginFolder> PluginFolders { get; private set; }
  211. /// <summary>
  212. /// Gets the list of available user repositories
  213. /// </summary>
  214. /// <value>The user repositories.</value>
  215. private IEnumerable<IUserRepository> UserRepositories { get; set; }
  216. /// <summary>
  217. /// Gets the active user repository
  218. /// </summary>
  219. /// <value>The user repository.</value>
  220. public IUserRepository UserRepository { get; private set; }
  221. /// <summary>
  222. /// Gets the active user repository
  223. /// </summary>
  224. /// <value>The display preferences repository.</value>
  225. public IDisplayPreferencesRepository DisplayPreferencesRepository { get; private set; }
  226. /// <summary>
  227. /// Gets the list of available item repositories
  228. /// </summary>
  229. /// <value>The item repositories.</value>
  230. private IEnumerable<IItemRepository> ItemRepositories { get; set; }
  231. /// <summary>
  232. /// Gets the active item repository
  233. /// </summary>
  234. /// <value>The item repository.</value>
  235. public IItemRepository ItemRepository { get; private set; }
  236. /// <summary>
  237. /// Gets the list of available item repositories
  238. /// </summary>
  239. /// <value>The user data repositories.</value>
  240. private IEnumerable<IUserDataRepository> UserDataRepositories { get; set; }
  241. /// <summary>
  242. /// Gets the list of available DisplayPreferencesRepositories
  243. /// </summary>
  244. /// <value>The display preferences repositories.</value>
  245. private IEnumerable<IDisplayPreferencesRepository> DisplayPreferencesRepositories { get; set; }
  246. /// <summary>
  247. /// Gets the list of entity resolution ignore rules
  248. /// </summary>
  249. /// <value>The entity resolution ignore rules.</value>
  250. internal IEnumerable<IResolutionIgnoreRule> EntityResolutionIgnoreRules { get; private set; }
  251. /// <summary>
  252. /// Gets the active user data repository
  253. /// </summary>
  254. /// <value>The user data repository.</value>
  255. public IUserDataRepository UserDataRepository { get; private set; }
  256. /// <summary>
  257. /// Limits simultaneous access to various resources
  258. /// </summary>
  259. /// <value>The resource pools.</value>
  260. public ResourcePool ResourcePools { get; set; }
  261. /// <summary>
  262. /// Gets the UDP server port number.
  263. /// </summary>
  264. /// <value>The UDP server port number.</value>
  265. public override int UdpServerPortNumber
  266. {
  267. get { return 7359; }
  268. }
  269. /// <summary>
  270. /// Gets or sets the zip client.
  271. /// </summary>
  272. /// <value>The zip client.</value>
  273. private IZipClient ZipClient { get; set; }
  274. /// <summary>
  275. /// Gets or sets the bluray examiner.
  276. /// </summary>
  277. /// <value>The bluray examiner.</value>
  278. private IBlurayExaminer BlurayExaminer { get; set; }
  279. /// <summary>
  280. /// Creates a kernel based on a Data path, which is akin to our current programdata path
  281. /// </summary>
  282. /// <param name="appHost">The app host.</param>
  283. /// <param name="isoManager">The iso manager.</param>
  284. /// <param name="zipClient">The zip client.</param>
  285. /// <param name="blurayExaminer">The bluray examiner.</param>
  286. /// <param name="logger">The logger.</param>
  287. /// <exception cref="System.ArgumentNullException">isoManager</exception>
  288. public Kernel(IApplicationHost appHost, IIsoManager isoManager, IZipClient zipClient, IBlurayExaminer blurayExaminer, ILogger logger)
  289. : base(appHost, isoManager, logger)
  290. {
  291. if (isoManager == null)
  292. {
  293. throw new ArgumentNullException("isoManager");
  294. }
  295. if (zipClient == null)
  296. {
  297. throw new ArgumentNullException("zipClient");
  298. }
  299. if (blurayExaminer == null)
  300. {
  301. throw new ArgumentNullException("blurayExaminer");
  302. }
  303. Instance = this;
  304. ZipClient = zipClient;
  305. BlurayExaminer = blurayExaminer;
  306. // For now there's no real way to inject this properly
  307. BaseItem.Logger = logger;
  308. Ratings.Logger = logger;
  309. LocalizedStrings.Logger = logger;
  310. // For now, until this can become an interface
  311. BaseMetadataProvider.Logger = logger;
  312. }
  313. /// <summary>
  314. /// Composes the exported values.
  315. /// </summary>
  316. /// <param name="container">The container.</param>
  317. /// <param name="iocContainer">The _ioc container.</param>
  318. protected override void ComposeExportedValues(CompositionContainer container, Container iocContainer)
  319. {
  320. base.ComposeExportedValues(container, iocContainer);
  321. container.ComposeExportedValue("kernel", this);
  322. container.ComposeExportedValue("blurayExaminer", BlurayExaminer);
  323. iocContainer.RegisterSingle(this);
  324. iocContainer.RegisterSingle(BlurayExaminer);
  325. }
  326. /// <summary>
  327. /// Composes the parts with ioc container.
  328. /// </summary>
  329. /// <param name="allTypes">All types.</param>
  330. /// <param name="container">The container.</param>
  331. protected override void ComposePartsWithIocContainer(Type[] allTypes, Container container)
  332. {
  333. base.ComposePartsWithIocContainer(allTypes, container);
  334. EntityResolutionIgnoreRules = GetExports<IResolutionIgnoreRule>(allTypes);
  335. UserDataRepositories = GetExports<IUserDataRepository>(allTypes);
  336. UserRepositories = GetExports<IUserRepository>(allTypes);
  337. DisplayPreferencesRepositories = GetExports<IDisplayPreferencesRepository>(allTypes);
  338. ItemRepositories = GetExports<IItemRepository>(allTypes);
  339. WeatherProviders = GetExports<IWeatherProvider>(allTypes);
  340. IntroProviders = GetExports<IIntroProvider>(allTypes);
  341. PluginConfigurationPages = GetExports<IPluginConfigurationPage>(allTypes);
  342. ImageEnhancers = GetExports<IImageEnhancer>(allTypes);
  343. }
  344. /// <summary>
  345. /// Performs initializations that can be reloaded at anytime
  346. /// </summary>
  347. /// <returns>Task.</returns>
  348. protected override async Task ReloadInternal()
  349. {
  350. Logger.Info("Extracting tools");
  351. // Reset these so that they can be lazy loaded again
  352. Users = null;
  353. RootFolder = null;
  354. ReloadResourcePools();
  355. InstallationManager = new InstallationManager(this, ZipClient, Logger);
  356. LibraryManager = new LibraryManager(this, Logger);
  357. UserManager = new UserManager(this, Logger);
  358. FFMpegManager = new FFMpegManager(this, ZipClient, Logger);
  359. ImageManager = new ImageManager(this, Logger);
  360. ProviderManager = new ProviderManager(this, Logger);
  361. UserDataManager = new UserDataManager(this, Logger);
  362. PluginSecurityManager = new PluginSecurityManager(this);
  363. await base.ReloadInternal().ConfigureAwait(false);
  364. ReloadFileSystemManager();
  365. await UserManager.RefreshUsersMetadata(CancellationToken.None).ConfigureAwait(false);
  366. }
  367. /// <summary>
  368. /// Releases unmanaged and - optionally - managed resources.
  369. /// </summary>
  370. /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
  371. protected override void Dispose(bool dispose)
  372. {
  373. if (dispose)
  374. {
  375. DisposeResourcePools();
  376. DisposeFileSystemManager();
  377. }
  378. base.Dispose(dispose);
  379. }
  380. /// <summary>
  381. /// Disposes the resource pools.
  382. /// </summary>
  383. private void DisposeResourcePools()
  384. {
  385. if (ResourcePools != null)
  386. {
  387. ResourcePools.Dispose();
  388. ResourcePools = null;
  389. }
  390. }
  391. /// <summary>
  392. /// Reloads the resource pools.
  393. /// </summary>
  394. private void ReloadResourcePools()
  395. {
  396. DisposeResourcePools();
  397. ResourcePools = new ResourcePool();
  398. }
  399. /// <summary>
  400. /// Called when [composable parts loaded].
  401. /// </summary>
  402. /// <returns>Task.</returns>
  403. protected override async Task OnComposablePartsLoaded()
  404. {
  405. // The base class will start up all the plugins
  406. await base.OnComposablePartsLoaded().ConfigureAwait(false);
  407. // Get the current item repository
  408. ItemRepository = GetRepository(ItemRepositories, Configuration.ItemRepository);
  409. var itemRepoTask = ItemRepository.Initialize();
  410. // Get the current user repository
  411. UserRepository = GetRepository(UserRepositories, Configuration.UserRepository);
  412. var userRepoTask = UserRepository.Initialize();
  413. // Get the current item repository
  414. UserDataRepository = GetRepository(UserDataRepositories, Configuration.UserDataRepository);
  415. var userDataRepoTask = UserDataRepository.Initialize();
  416. // Get the current display preferences repository
  417. DisplayPreferencesRepository = GetRepository(DisplayPreferencesRepositories, Configuration.DisplayPreferencesRepository);
  418. var displayPreferencesRepoTask = DisplayPreferencesRepository.Initialize();
  419. // Sort the resolvers by priority
  420. EntityResolvers = EntityResolvers.OrderBy(e => e.Priority).ToArray();
  421. // Sort the providers by priority
  422. MetadataProviders = MetadataProviders.OrderBy(e => e.Priority).ToArray();
  423. // Sort the image processors by priority
  424. ImageEnhancers = ImageEnhancers.OrderBy(e => e.Priority).ToArray();
  425. await Task.WhenAll(itemRepoTask, userRepoTask, userDataRepoTask, displayPreferencesRepoTask).ConfigureAwait(false);
  426. }
  427. /// <summary>
  428. /// Gets a repository by name from a list, and returns the default if not found
  429. /// </summary>
  430. /// <typeparam name="T"></typeparam>
  431. /// <param name="repositories">The repositories.</param>
  432. /// <param name="name">The name.</param>
  433. /// <returns>``0.</returns>
  434. private T GetRepository<T>(IEnumerable<T> repositories, string name)
  435. where T : class, IRepository
  436. {
  437. var enumerable = repositories as T[] ?? repositories.ToArray();
  438. return enumerable.FirstOrDefault(r => string.Equals(r.Name, name, StringComparison.OrdinalIgnoreCase)) ??
  439. enumerable.FirstOrDefault();
  440. }
  441. /// <summary>
  442. /// Disposes the file system manager.
  443. /// </summary>
  444. private void DisposeFileSystemManager()
  445. {
  446. if (FileSystemManager != null)
  447. {
  448. FileSystemManager.Dispose();
  449. FileSystemManager = null;
  450. }
  451. }
  452. /// <summary>
  453. /// Reloads the file system manager.
  454. /// </summary>
  455. private void ReloadFileSystemManager()
  456. {
  457. DisposeFileSystemManager();
  458. FileSystemManager = new FileSystemManager(this, Logger);
  459. FileSystemManager.StartWatchers();
  460. }
  461. /// <summary>
  462. /// Gets a User by Id
  463. /// </summary>
  464. /// <param name="id">The id.</param>
  465. /// <returns>User.</returns>
  466. /// <exception cref="System.ArgumentNullException"></exception>
  467. public User GetUserById(Guid id)
  468. {
  469. if (id == Guid.Empty)
  470. {
  471. throw new ArgumentNullException();
  472. }
  473. return Users.FirstOrDefault(u => u.Id == id);
  474. }
  475. /// <summary>
  476. /// Finds a library item by Id and UserId.
  477. /// </summary>
  478. /// <param name="id">The id.</param>
  479. /// <param name="userId">The user id.</param>
  480. /// <returns>BaseItem.</returns>
  481. /// <exception cref="System.ArgumentNullException">id</exception>
  482. public BaseItem GetItemById(Guid id, Guid userId)
  483. {
  484. if (id == Guid.Empty)
  485. {
  486. throw new ArgumentNullException("id");
  487. }
  488. if (userId == Guid.Empty)
  489. {
  490. throw new ArgumentNullException("userId");
  491. }
  492. var user = GetUserById(userId);
  493. var userRoot = user.RootFolder;
  494. return userRoot.FindItemById(id, user);
  495. }
  496. /// <summary>
  497. /// Gets the item by id.
  498. /// </summary>
  499. /// <param name="id">The id.</param>
  500. /// <returns>BaseItem.</returns>
  501. /// <exception cref="System.ArgumentNullException">id</exception>
  502. public BaseItem GetItemById(Guid id)
  503. {
  504. if (id == Guid.Empty)
  505. {
  506. throw new ArgumentNullException("id");
  507. }
  508. return RootFolder.FindItemById(id, null);
  509. }
  510. /// <summary>
  511. /// Completely overwrites the current configuration with a new copy
  512. /// </summary>
  513. /// <param name="config">The config.</param>
  514. public void UpdateConfiguration(ServerConfiguration config)
  515. {
  516. var oldConfiguration = Configuration;
  517. var reloadLogger = config.ShowLogWindow != oldConfiguration.ShowLogWindow;
  518. // Figure out whether or not we should refresh people after the update is finished
  519. var refreshPeopleAfterUpdate = !oldConfiguration.EnableInternetProviders && config.EnableInternetProviders;
  520. // This is true if internet providers has just been turned on, or if People have just been removed from InternetProviderExcludeTypes
  521. if (!refreshPeopleAfterUpdate)
  522. {
  523. var oldConfigurationFetchesPeopleImages = oldConfiguration.InternetProviderExcludeTypes == null || !oldConfiguration.InternetProviderExcludeTypes.Contains(typeof(Person).Name, StringComparer.OrdinalIgnoreCase);
  524. var newConfigurationFetchesPeopleImages = config.InternetProviderExcludeTypes == null || !config.InternetProviderExcludeTypes.Contains(typeof(Person).Name, StringComparer.OrdinalIgnoreCase);
  525. refreshPeopleAfterUpdate = newConfigurationFetchesPeopleImages && !oldConfigurationFetchesPeopleImages;
  526. }
  527. Configuration = config;
  528. SaveConfiguration();
  529. if (reloadLogger)
  530. {
  531. ReloadLogger();
  532. }
  533. TcpManager.OnApplicationConfigurationChanged(oldConfiguration, config);
  534. // Validate currently executing providers, in the background
  535. Task.Run(() =>
  536. {
  537. ProviderManager.ValidateCurrentlyRunningProviders();
  538. // Any number of configuration settings could change the way the library is refreshed, so do that now
  539. TaskManager.CancelIfRunningAndQueue<RefreshMediaLibraryTask>();
  540. if (refreshPeopleAfterUpdate)
  541. {
  542. TaskManager.CancelIfRunningAndQueue<PeopleValidationTask>();
  543. }
  544. });
  545. }
  546. /// <summary>
  547. /// Removes the plugin.
  548. /// </summary>
  549. /// <param name="plugin">The plugin.</param>
  550. internal void RemovePlugin(IPlugin plugin)
  551. {
  552. var list = Plugins.ToList();
  553. list.Remove(plugin);
  554. Plugins = list;
  555. }
  556. /// <summary>
  557. /// Gets the system info.
  558. /// </summary>
  559. /// <returns>SystemInfo.</returns>
  560. public override SystemInfo GetSystemInfo()
  561. {
  562. var info = base.GetSystemInfo();
  563. if (InstallationManager != null)
  564. {
  565. info.InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray();
  566. info.CompletedInstallations = InstallationManager.CompletedInstallations.ToArray();
  567. }
  568. return info;
  569. }
  570. }
  571. }