Fix bug where book with corrupt image cannot be queued.
This commit is contained in:
parent
245e55782e
commit
5ec01913d5
11 changed files with 58 additions and 67 deletions
|
|
@ -67,7 +67,7 @@ namespace LibationFileManager
|
|||
}
|
||||
|
||||
DownloadQueue.Add(def);
|
||||
return (true, getDefaultImage(def.Size));
|
||||
return (true, GetDefaultImage(def.Size));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ namespace LibationFileManager
|
|||
|
||||
public static void SetDefaultImage(PictureSize pictureSize, byte[] bytes)
|
||||
=> defaultImages[pictureSize] = bytes;
|
||||
private static byte[] getDefaultImage(PictureSize size)
|
||||
public static byte[] GetDefaultImage(PictureSize size)
|
||||
=> defaultImages.ContainsKey(size)
|
||||
? defaultImages[size]
|
||||
: new byte[0];
|
||||
|
|
@ -120,7 +120,7 @@ namespace LibationFileManager
|
|||
private static byte[] downloadBytes(PictureDefinition def)
|
||||
{
|
||||
if (def.PictureId is null)
|
||||
return getDefaultImage(def.Size);
|
||||
return GetDefaultImage(def.Size);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -135,7 +135,7 @@ namespace LibationFileManager
|
|||
}
|
||||
catch
|
||||
{
|
||||
return getDefaultImage(def.Size);
|
||||
return GetDefaultImage(def.Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue