mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Fix duplicated exception when the item was deleted
This commit is contained in:
parent
a01ce5c11c
commit
f0e6ee5835
@ -19,8 +19,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Kyoo.Abstractions.Models;
|
using Kyoo.Abstractions.Models;
|
||||||
|
|
||||||
#nullable enable
|
|
||||||
|
|
||||||
namespace Kyoo.Abstractions.Controllers
|
namespace Kyoo.Abstractions.Controllers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -140,7 +140,7 @@ namespace Kyoo.Core.Controllers
|
|||||||
{
|
{
|
||||||
lock (_downloading)
|
lock (_downloading)
|
||||||
{
|
{
|
||||||
if (File.Exists(posterPath) || _downloading.ContainsKey(posterPath))
|
if (_downloading.ContainsKey(posterPath))
|
||||||
{
|
{
|
||||||
duplicated = true;
|
duplicated = true;
|
||||||
sync = _downloading.GetValueOrDefault(posterPath);
|
sync = _downloading.GetValueOrDefault(posterPath);
|
||||||
@ -154,7 +154,8 @@ namespace Kyoo.Core.Controllers
|
|||||||
if (duplicated)
|
if (duplicated)
|
||||||
{
|
{
|
||||||
object? dup = sync != null ? await sync.Task : null;
|
object? dup = sync != null ? await sync.Task : null;
|
||||||
throw new DuplicatedItemException(dup);
|
if (dup != null)
|
||||||
|
throw new DuplicatedItemException(dup);
|
||||||
}
|
}
|
||||||
|
|
||||||
await _DownloadImage(
|
await _DownloadImage(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user