diff --git a/FoliCon/Modules/DeviantArt/DArt.cs b/FoliCon/Modules/DeviantArt/DArt.cs index 8a6d5f8..14f21dd 100644 --- a/FoliCon/Modules/DeviantArt/DArt.cs +++ b/FoliCon/Modules/DeviantArt/DArt.cs @@ -52,7 +52,7 @@ public static async Task GetInstanceAsync(string clientSecret, string clie return dArt; } - public async Task GetClientAccessTokenAsync() + private async Task GetClientAccessTokenAsync() { if (!_cache.TryGetValue("DArtToken", out string cachedToken)) { @@ -93,7 +93,7 @@ private async Task GenerateNewAccessToken() public async Task Browse(string query, int offset = 0) { - GetClientAccessTokenAsync(); + await GetClientAccessTokenAsync(); var url = GetBrowseApiUrl(query, offset); using var response = await Services.HttpC.GetAsync(new Uri(url)); @@ -111,7 +111,7 @@ public async Task Browse(string query, int offset = 0) /// The DArtDownloadResponse object containing the download details. public async Task Download(string deviationId) { - GetClientAccessTokenAsync(); + await GetClientAccessTokenAsync(); var dArtDownloadResponse = await GetDArtDownloadResponseAsync(deviationId); await TryExtraction(deviationId, dArtDownloadResponse, CancellationToken.None, new Progress(_ => { })); @@ -144,7 +144,7 @@ public async Task ExtractDeviation(string deviationId, DArtDownloadResponse dArtDownloadResponse, CancellationToken cancellationToken, IProgress progressCallback) { - GetClientAccessTokenAsync(); + await GetClientAccessTokenAsync(); return await TryExtraction(deviationId, dArtDownloadResponse, cancellationToken, progressCallback); }