Bug fix #474
This commit is contained in:
parent
85769d797b
commit
39fe7b79d2
@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Version>9.2.1.1</Version>
|
<Version>9.2.2.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Octokit" Version="5.0.0" />
|
<PackageReference Include="Octokit" Version="5.0.0" />
|
||||||
|
|||||||
@ -131,6 +131,15 @@ namespace LibationAvalonia.ViewModels
|
|||||||
|
|
||||||
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
||||||
{
|
{
|
||||||
|
// state validation
|
||||||
|
if (e is null ||
|
||||||
|
e.Definition.PictureId is null ||
|
||||||
|
Book?.PictureId is null ||
|
||||||
|
e.Picture is null ||
|
||||||
|
e.Picture.Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// logic validation
|
||||||
if (e.Definition.PictureId == Book.PictureId)
|
if (e.Definition.PictureId == Book.PictureId)
|
||||||
{
|
{
|
||||||
using var ms = new System.IO.MemoryStream(e.Picture);
|
using var ms = new System.IO.MemoryStream(e.Picture);
|
||||||
|
|||||||
@ -140,6 +140,15 @@ namespace LibationWinForms.GridView
|
|||||||
|
|
||||||
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
private void PictureStorage_PictureCached(object sender, PictureCachedEventArgs e)
|
||||||
{
|
{
|
||||||
|
// state validation
|
||||||
|
if (e is null ||
|
||||||
|
e.Definition.PictureId is null ||
|
||||||
|
Book?.PictureId is null ||
|
||||||
|
e.Picture is null ||
|
||||||
|
e.Picture.Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// logic validation
|
||||||
if (e.Definition.PictureId == Book.PictureId)
|
if (e.Definition.PictureId == Book.PictureId)
|
||||||
{
|
{
|
||||||
Cover = ImageReader.ToImage(e.Picture);
|
Cover = ImageReader.ToImage(e.Picture);
|
||||||
|
|||||||
@ -64,16 +64,6 @@
|
|||||||
<DependentUpon>SettingsDialog.cs</DependentUpon>
|
<DependentUpon>SettingsDialog.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Form1.*.cs">
|
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Form1.*.cs">
|
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user