Skip to content

Commit f1448d7

Browse files
committed
JastUsaLibrary: Set logger from constructor parameter in downloads manager
1 parent 741101a commit f1448d7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

source/Library/JastUsaLibrary/Features/DownloadManager/Application/DownloadsManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void OnGameInstallationApplied(Game game, Program program)
4141
GameInstallationApplied?.Invoke(this, new GameInstallationAppliedEventArgs(game, program));
4242
}
4343

44-
private static readonly ILogger _logger = LogManager.GetLogger();
44+
private readonly ILogger _logger;
4545
private readonly IPlayniteAPI _playniteApi;
4646
private readonly ILibraryCacheService _libraryCacheService;
4747
private readonly IGameInstallationManagerService _gameInstallationManagerService;
@@ -65,19 +65,21 @@ public DownloadsManager(
6565
JastUsaLibrary plugin,
6666
JastUsaAccountClient jastAccountClient,
6767
JastUsaLibrarySettingsViewModel settingsViewModel,
68+
ILogger logger,
6869
IPlayniteAPI playniteApi,
6970
IDownloadDataPersistence downloadsPersistence,
7071
ILibraryCacheService libraryCacheService,
7172
IGameInstallationManagerService gameInstallationManagerService)
7273
{
74+
_logger = Guard.Against.Null(logger);
7375
_playniteApi = Guard.Against.Null(playniteApi);
7476
_libraryCacheService = Guard.Against.Null(libraryCacheService);
7577
_gameInstallationManagerService = Guard.Against.Null(gameInstallationManagerService);
7678
_plugin = Guard.Against.Null(plugin);
7779
_downloadsPersistence = Guard.Against.Null(downloadsPersistence);
7880
_jastAccountClient = Guard.Against.Null(jastAccountClient);
7981
_settingsViewModel = Guard.Against.Null(settingsViewModel);
80-
_downloadsList = new ObservableCollection<DownloadItem>();
82+
_downloadsList = new ObservableCollection<DownloadItem>();
8183
Task.Run(async () => await RestorePersistingDownloads()).Wait();
8284
_persistOnListChanges = true;
8385
_enableDownloadsOnAdd = true;

source/Library/JastUsaLibrary/JastUsaLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public JastUsaLibrary(IPlayniteAPI api) : base(api)
6060
settings = new JastUsaLibrarySettingsViewModel(this, PlayniteApi, _jastUsaAccountClient);
6161
_gameInstallationManagerService = new GameInstallationManagerService(PlayniteApi, new GameInstallationManagerPersistenceJson(GetPluginUserDataPath(), _logger));
6262
_jastUsaCacheService = new LibraryCacheService(PlayniteApi, new LibraryCachePersistenceJson(GetPluginUserDataPath(), _logger), Id);
63-
_downloadsManager = new DownloadsManager(this, _jastUsaAccountClient, settings, PlayniteApi, new DownloadDataPersistenceJson(_logger, GetPluginUserDataPath()), _jastUsaCacheService, _gameInstallationManagerService);
63+
_downloadsManager = new DownloadsManager(this, _jastUsaAccountClient, settings, _logger, PlayniteApi, new DownloadDataPersistenceJson(_logger, GetPluginUserDataPath()), _jastUsaCacheService, _gameInstallationManagerService);
6464
Properties = new LibraryPluginProperties
6565
{
6666
HasSettings = true

0 commit comments

Comments
 (0)