diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 202443e..9aa4b5f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,11 +32,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 # Override language selection by uncommenting this and choosing your languages with: languages: csharp @@ -44,7 +44,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -58,4 +58,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 \ No newline at end of file + uses: github/codeql-action/analyze@v3 \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index a679768..5ec80ae 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ CasCap - 11.0 + 12.0 bf9d717e-ecd3-40e4-850d-14010c167289 @@ -46,7 +46,7 @@ - + diff --git a/README.md b/README.md index 5cbb1d0..990e89a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ > Want to save yourself some coding? See the _preview_ release of [GooglePhotosCli](https://github.com/f2calv/CasCap.GooglePhotosCli) using this library... -This is an _unofficial_ Google Photos REST API library targeting .NET 6.0 & .NET 7.0. +This is an _unofficial_ Google Photos REST API library targeting .NET 8.0. Note: Older projects that require .NET Standard 2.0 please use version 1.x of this library. diff --git a/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index 8ba8a0d..60f72e8 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -2,8 +2,7 @@ Exe - net6.0 - $(TargetFrameworks);net7.0 + net8.0 diff --git a/samples/GenericHost/GenericHost.csproj b/samples/GenericHost/GenericHost.csproj index 1eeed32..27ea2e1 100644 --- a/samples/GenericHost/GenericHost.csproj +++ b/samples/GenericHost/GenericHost.csproj @@ -2,19 +2,18 @@ Exe - net6.0 - $(TargetFrameworks);net7.0 + net8.0 - - - - - - - + + + + + + + diff --git a/src/CasCap.Apis.GooglePhotos.Tests/CasCap.Apis.GooglePhotos.Tests.csproj b/src/CasCap.Apis.GooglePhotos.Tests/CasCap.Apis.GooglePhotos.Tests.csproj index d23ae3e..d97c4ea 100644 --- a/src/CasCap.Apis.GooglePhotos.Tests/CasCap.Apis.GooglePhotos.Tests.csproj +++ b/src/CasCap.Apis.GooglePhotos.Tests/CasCap.Apis.GooglePhotos.Tests.csproj @@ -1,20 +1,19 @@  - net6.0 - $(TargetFrameworks);net7.0 + net8.0 - + - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CasCap.Apis.GooglePhotos.Tests/Tests/ExifTests.cs b/src/CasCap.Apis.GooglePhotos.Tests/Tests/ExifTests.cs index 5962ef6..db3cbf2 100644 --- a/src/CasCap.Apis.GooglePhotos.Tests/Tests/ExifTests.cs +++ b/src/CasCap.Apis.GooglePhotos.Tests/Tests/ExifTests.cs @@ -1,6 +1,7 @@ using CasCap.Models; using CasCap.Services; using CasCap.Xunit; +using SixLabors.ImageSharp; using SixLabors.ImageSharp.Metadata.Profiles.Exif; using System.Diagnostics; using Xunit; diff --git a/src/CasCap.Apis.GooglePhotos/CasCap.Apis.GooglePhotos.csproj b/src/CasCap.Apis.GooglePhotos/CasCap.Apis.GooglePhotos.csproj index c4fb23f..ae71481 100644 --- a/src/CasCap.Apis.GooglePhotos/CasCap.Apis.GooglePhotos.csproj +++ b/src/CasCap.Apis.GooglePhotos/CasCap.Apis.GooglePhotos.csproj @@ -1,8 +1,7 @@  - net6.0 - $(TargetFrameworks);net7.0 + net8.0 true enable @@ -26,11 +25,11 @@ - - - + + + - + 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