diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-01-28 11:29:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-28 11:29:46 +0100 |
| commit | 973489232205755abe16762c1e3446f2236349f2 (patch) | |
| tree | a5777cf5c4718bd3f9e75670e34cfef77e64243b /MediaBrowser.Providers/Plugins | |
| parent | bcdffa74a80972f8493837fa911c9628598f7fa3 (diff) | |
| parent | d2db7004024c6bbdd541a381c673f1e0b0aebfcb (diff) | |
Merge pull request #12925 from Bond-009/await
Always await instead of directly returning Task
Diffstat (limited to 'MediaBrowser.Providers/Plugins')
3 files changed, 10 insertions, 12 deletions
diff --git a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbAlbumProvider.cs b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbAlbumProvider.cs index daad9706c..ff30af879 100644 --- a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbAlbumProvider.cs +++ b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbAlbumProvider.cs @@ -148,21 +148,19 @@ namespace MediaBrowser.Providers.Plugins.AudioDb item.Overview = (overview ?? string.Empty).StripHtml(); } - internal Task EnsureInfo(string musicBrainzReleaseGroupId, CancellationToken cancellationToken) + internal async Task EnsureInfo(string musicBrainzReleaseGroupId, CancellationToken cancellationToken) { var xmlPath = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId); var fileInfo = _fileSystem.GetFileSystemInfo(xmlPath); - if (fileInfo.Exists) + if (fileInfo.Exists + && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 2) { - if ((DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 2) - { - return Task.CompletedTask; - } + return; } - return DownloadInfo(musicBrainzReleaseGroupId, cancellationToken); + await DownloadInfo(musicBrainzReleaseGroupId, cancellationToken).ConfigureAwait(false); } internal async Task DownloadInfo(string musicBrainzReleaseGroupId, CancellationToken cancellationToken) diff --git a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs index 92742b1aa..00bd96282 100644 --- a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs +++ b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs @@ -131,7 +131,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb item.Overview = (overview ?? string.Empty).StripHtml(); } - internal Task EnsureArtistInfo(string musicBrainzId, CancellationToken cancellationToken) + internal async Task EnsureArtistInfo(string musicBrainzId, CancellationToken cancellationToken) { var xmlPath = GetArtistInfoPath(_config.ApplicationPaths, musicBrainzId); @@ -140,10 +140,10 @@ namespace MediaBrowser.Providers.Plugins.AudioDb if (fileInfo.Exists && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 2) { - return Task.CompletedTask; + return; } - return DownloadArtistInfo(musicBrainzId, cancellationToken); + await DownloadArtistInfo(musicBrainzId, cancellationToken).ConfigureAwait(false); } internal async Task DownloadArtistInfo(string musicBrainzId, CancellationToken cancellationToken) diff --git a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs index 5ca9f6f9a..a50d69df5 100644 --- a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs +++ b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs @@ -101,11 +101,11 @@ namespace MediaBrowser.Providers.Plugins.StudioImages return string.Format(CultureInfo.InvariantCulture, "{0}/images/{1}/{2}.jpg", GetRepositoryUrl(), image, filename); } - private Task EnsureThumbsList(string file, CancellationToken cancellationToken) + private async Task EnsureThumbsList(string file, CancellationToken cancellationToken) { string url = string.Format(CultureInfo.InvariantCulture, "{0}/thumbs.txt", GetRepositoryUrl()); - return EnsureList(url, file, _fileSystem, cancellationToken); + await EnsureList(url, file, _fileSystem, cancellationToken).ConfigureAwait(false); } /// <inheritdoc /> |
