From cca7b5857e9aa1c6b04c2a1e068216a8f667b46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=AF=9A?= Date: Thu, 3 Apr 2025 12:03:40 +0800 Subject: [PATCH] 1 --- src/Service/Jobs/ChineseNfoRegistry.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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++; }