diff options
| author | Bond-009 <bond.009@outlook.com> | 2022-12-07 18:14:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 18:14:32 +0100 |
| commit | 16fdb127ab9c97ec9366b9e740ea4ab929f97f0f (patch) | |
| tree | b3e3a2d4eba8dfe79ecdd5f54bd535bd7441b202 | |
| parent | 8258d884f306c437e3275b62fd5b4bd30ffb1944 (diff) | |
Check HTTP status code before writing response to file (#8863)
fix https://github.com/jellyfin/jellyfin/issues/8084
| -rw-r--r-- | MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs index 40c489885..1565a8c51 100644 --- a/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs +++ b/MediaBrowser.Providers/Plugins/AudioDb/AudioDbArtistProvider.cs @@ -149,11 +149,11 @@ namespace MediaBrowser.Providers.Plugins.AudioDb var url = BaseUrl + "/artist-mb.php?i=" + musicBrainzId; - var path = GetArtistInfoPath(_config.ApplicationPaths, musicBrainzId); - using var response = await _httpClientFactory.CreateClient(NamedClient.Default).GetAsync(url, cancellationToken).ConfigureAwait(false); + response.EnsureSuccessStatusCode(); await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + var path = GetArtistInfoPath(_config.ApplicationPaths, musicBrainzId); Directory.CreateDirectory(Path.GetDirectoryName(path)); var fileStreamOptions = AsyncFile.WriteOptions; |
