Fix Null Refs with ImageUrl
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<AssemblyVersion>2020.3.24.0</AssemblyVersion>
|
||||
<FileVersion>2020.3.24.0</FileVersion>
|
||||
<AssemblyVersion>2020.3.25.0</AssemblyVersion>
|
||||
<FileVersion>2020.3.25.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Booru.Net.Tests
|
||||
|
||||
if (posts != null)
|
||||
{
|
||||
Console.WriteLine(posts.All(x => x != null));
|
||||
Console.WriteLine(posts.All(x => x.ImageUrl != null));
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
|
||||
@@ -24,10 +24,10 @@ Yande.re</Description>
|
||||
<PackageTags>booru imageboard api wrapper</PackageTags>
|
||||
<PackageLicenseUrl></PackageLicenseUrl>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<Version>2.0.2</Version>
|
||||
<Version>2.0.3</Version>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<AssemblyVersion>2.0.2.0</AssemblyVersion>
|
||||
<FileVersion>2.0.2.0</FileVersion>
|
||||
<AssemblyVersion>2.0.3.0</AssemblyVersion>
|
||||
<FileVersion>2.0.3.0</FileVersion>
|
||||
<PackageReleaseNotes>Readded DanBooruImage#Score from Inheritence Rework</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ namespace Booru.Net
|
||||
[JsonProperty("score")]
|
||||
public int? Score { get; set; }
|
||||
|
||||
[JsonProperty("file_url")]
|
||||
private string FileUrl { get; set; }
|
||||
|
||||
public override string ImageUrl
|
||||
=> FileUrl;
|
||||
|
||||
[JsonProperty("tag_string")]
|
||||
private string TagString { get; set; }
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@ namespace Booru.Net
|
||||
[JsonProperty("directory")]
|
||||
public string Directory { get; set; }
|
||||
|
||||
[JsonProperty("file_url")]
|
||||
private string FileUrl { get; set; }
|
||||
|
||||
public override string ImageUrl
|
||||
=> FileUrl;
|
||||
|
||||
[JsonProperty("tags")]
|
||||
private string Ptags { get; set; }
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Booru.Net
|
||||
[JsonProperty("rating")]
|
||||
private string Prating { get; set; }
|
||||
|
||||
public virtual string ImageUrl { get; set; }
|
||||
public virtual string ImageUrl { get; private set; }
|
||||
|
||||
public virtual string PostUrl { get; set; }
|
||||
public virtual string PostUrl { get; private set; }
|
||||
|
||||
public Rating Rating
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user