From 0873bbdbfa52bda9ae07951c5ca817fad3216f5d Mon Sep 17 00:00:00 2001 From: Alex Vincent Date: Fri, 12 Jan 2024 09:00:16 +0100 Subject: [PATCH] fix new warnings --- .../Services/Base/GooglePhotosServiceBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CasCap.Apis.GooglePhotos/Services/Base/GooglePhotosServiceBase.cs b/src/CasCap.Apis.GooglePhotos/Services/Base/GooglePhotosServiceBase.cs index 90d9cb8..49a7a5e 100644 --- a/src/CasCap.Apis.GooglePhotos/Services/Base/GooglePhotosServiceBase.cs +++ b/src/CasCap.Apis.GooglePhotos/Services/Base/GooglePhotosServiceBase.cs @@ -148,7 +148,7 @@ public async Task LoginAsync() _logger.LogDebug("Authorisation granted or not required (if the saved access token already available)"); - if (credential.Token.IsExpired(credential.Flow.Clock)) + if (credential.Token.IsStale) { _logger.LogWarning("The access token has expired, refreshing it"); if (await credential.RefreshTokenAsync(CancellationToken.None)) @@ -240,7 +240,7 @@ public Task> GetSharedAlbumsAsync(int pageSize = defaultPageSizeAlbu string GetUrl(string uri, int? pageSize = defaultPageSizeAlbums, bool excludeNonAppCreatedData = false, string? pageToken = null) { - var queryParams = new Dictionary(3); + var queryParams = new Dictionary(3); if (pageSize.HasValue && pageSize != defaultPageSizeAlbums) queryParams.Add(nameof(pageSize), pageSize.Value.ToString()); if (excludeNonAppCreatedData) queryParams.Add(nameof(excludeNonAppCreatedData), excludeNonAppCreatedData.ToString()); if (!string.IsNullOrWhiteSpace(pageToken)) queryParams.Add(nameof(pageToken), pageToken!);//todo: nullability look further into this