Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c1e7e93ed7 | |||
| ed236340cd |
@@ -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.29.0</AssemblyVersion>
|
||||
<FileVersion>2020.3.29.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Booru.Net.Tests
|
||||
break;
|
||||
case 1:
|
||||
var p = await new E621Client().GetImagesAsync().ConfigureAwait(false);
|
||||
Console.WriteLine(p.Posts.All(x => x != null));
|
||||
Console.WriteLine(p.Posts.Any(x => x.ImageUrl != null));
|
||||
break;
|
||||
case 2:
|
||||
posts = await new GelbooruClient().GetImagesAsync().ConfigureAwait(false);
|
||||
@@ -56,7 +56,7 @@ namespace Booru.Net.Tests
|
||||
|
||||
if (posts != null)
|
||||
{
|
||||
Console.WriteLine(posts.All(x => x != null));
|
||||
Console.WriteLine(posts.Any(x => x.ImageUrl != null));
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
|
||||
@@ -24,11 +24,11 @@ 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>
|
||||
<PackageReleaseNotes>Readded DanBooruImage#Score from Inheritence Rework</PackageReleaseNotes>
|
||||
<AssemblyVersion>2020.3.0.0</AssemblyVersion>
|
||||
<FileVersion>2020.3.0.0</FileVersion>
|
||||
<PackageReleaseNotes>Fix some null ref issues with images</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -12,12 +12,26 @@ namespace Booru.Net
|
||||
[JsonProperty("directory")]
|
||||
public string Directory { get; set; }
|
||||
|
||||
[JsonProperty("file")]
|
||||
public E621ImageSource File { get; set; }
|
||||
|
||||
[JsonProperty("preview")]
|
||||
public E621ImageSource PreviewImage { get; set; }
|
||||
|
||||
[JsonProperty("sample")]
|
||||
public E621ImageSource SampleImage { get; set; }
|
||||
|
||||
[JsonProperty("flags")]
|
||||
public E621ImageFlags Flags { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
[JsonConverter(typeof(TagGroupConverter))]
|
||||
private List<Dictionary<string, List<string>>> PTags { get; set; }
|
||||
|
||||
public IReadOnlyList<Dictionary<string, List<string>>> Tags { get { return PTags.AsReadOnly(); } }
|
||||
|
||||
public override string ImageUrl => File.Url;
|
||||
|
||||
public override string PostUrl { get { return "https://e621.net/post/show/" + ID; } }
|
||||
}
|
||||
}
|
||||
|
||||
25
Booru.Net/Models/Boards/E621ImageFlags.cs
Normal file
25
Booru.Net/Models/Boards/E621ImageFlags.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Booru.Net
|
||||
{
|
||||
public class E621ImageFlags
|
||||
{
|
||||
[JsonProperty("pending")]
|
||||
public bool Pending { get; private set; }
|
||||
|
||||
[JsonProperty("flagged")]
|
||||
public bool Flagged { get; private set; }
|
||||
|
||||
[JsonProperty("note_locked")]
|
||||
public bool NoteLocked { get; private set; }
|
||||
|
||||
[JsonProperty("status_locked")]
|
||||
public bool StatusLocked { get; private set; }
|
||||
|
||||
[JsonProperty("rating_locked")]
|
||||
public bool RatingLocked { get; private set; }
|
||||
|
||||
[JsonProperty("deleted")]
|
||||
public bool Deleted { get; private set; }
|
||||
}
|
||||
}
|
||||
28
Booru.Net/Models/Boards/E621ImageSource.cs
Normal file
28
Booru.Net/Models/Boards/E621ImageSource.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Booru.Net
|
||||
{
|
||||
public class E621ImageSource
|
||||
{
|
||||
[JsonProperty("width")]
|
||||
public int Width { get; private set; }
|
||||
|
||||
[JsonProperty("height")]
|
||||
public int Height { get; private set; }
|
||||
|
||||
[JsonProperty("ext")]
|
||||
public string Extension { get; private set; }
|
||||
|
||||
[JsonProperty("size")]
|
||||
public ulong Size { get; private set; }
|
||||
|
||||
[JsonProperty("has")]
|
||||
public bool Has { get; private set; }
|
||||
|
||||
[JsonProperty("md5")]
|
||||
public string MD5 { get; private set; }
|
||||
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; private 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