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()}");
|
var posterPath = tvShowFile.Replace("tvshow.nfo", $"poster.{poster.Split('.').Last()}");
|
||||||
|
|
||||||
if (File.Exists(posterPath))
|
|
||||||
{
|
|
||||||
File.Delete(posterPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
using var client = new HttpClient();
|
using var client = new HttpClient();
|
||||||
var response = await client.GetAsync(poster);
|
var response = await client.GetAsync(poster);
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var bytes = await response.Content.ReadAsByteArrayAsync();
|
var bytes = await response.Content.ReadAsByteArrayAsync();
|
||||||
|
|
||||||
|
if (File.Exists(posterPath))
|
||||||
|
{
|
||||||
|
File.Delete(posterPath);
|
||||||
|
}
|
||||||
|
|
||||||
await File.WriteAllBytesAsync(posterPath, bytes);
|
await File.WriteAllBytesAsync(posterPath, bytes);
|
||||||
successCount++;
|
successCount++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user