diff --git a/src/Service/Jobs/ChineseNfoRegistry.cs b/src/Service/Jobs/ChineseNfoRegistry.cs index 50139d4..0e1a39f 100644 --- a/src/Service/Jobs/ChineseNfoRegistry.cs +++ b/src/Service/Jobs/ChineseNfoRegistry.cs @@ -194,16 +194,17 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry // 下载并覆盖海报 var posterPath = tvShowFile.Replace("tvshow.nfo", $"poster.{poster.Split('.').Last()}"); - if (File.Exists(posterPath)) - { - File.Delete(posterPath); - } - using var client = new HttpClient(); var response = await client.GetAsync(poster); if (response.IsSuccessStatusCode) { var bytes = await response.Content.ReadAsByteArrayAsync(); + + if (File.Exists(posterPath)) + { + File.Delete(posterPath); + } + await File.WriteAllBytesAsync(posterPath, bytes); successCount++; }