1
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user