diff --git a/Booru.Net.Tests/Booru.Net.Tests.csproj b/Booru.Net.Tests/Booru.Net.Tests.csproj
index 2e818e3..abc4ce5 100644
--- a/Booru.Net.Tests/Booru.Net.Tests.csproj
+++ b/Booru.Net.Tests/Booru.Net.Tests.csproj
@@ -3,8 +3,8 @@
Exe
netcoreapp2.1
- 2020.3.25.0
- 2020.3.25.0
+ 2020.3.29.0
+ 2020.3.29.0
diff --git a/Booru.Net.Tests/Program.cs b/Booru.Net.Tests/Program.cs
index 4a1fc69..ee18f01 100644
--- a/Booru.Net.Tests/Program.cs
+++ b/Booru.Net.Tests/Program.cs
@@ -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.ImageUrl != null));
+ Console.WriteLine(posts.Any(x => x.ImageUrl != null));
}
}
catch(Exception ex)
diff --git a/Booru.Net/Booru.Net.csproj b/Booru.Net/Booru.Net.csproj
index e14a93a..a28ad91 100644
--- a/Booru.Net/Booru.Net.csproj
+++ b/Booru.Net/Booru.Net.csproj
@@ -26,9 +26,9 @@ Yande.re
true
2.0.3
LICENSE
- 2.0.3.0
- 2.0.3.0
- Readded DanBooruImage#Score from Inheritence Rework
+ 2020.3.0.0
+ 2020.3.0.0
+ Fix some null ref issues with images
diff --git a/Booru.Net/Models/Boards/E621Image.cs b/Booru.Net/Models/Boards/E621Image.cs
index 200e10c..d28a0ea 100644
--- a/Booru.Net/Models/Boards/E621Image.cs
+++ b/Booru.Net/Models/Boards/E621Image.cs
@@ -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>> PTags { get; set; }
public IReadOnlyList>> Tags { get { return PTags.AsReadOnly(); } }
+ public override string ImageUrl => File.Url;
+
public override string PostUrl { get { return "https://e621.net/post/show/" + ID; } }
}
}
diff --git a/Booru.Net/Models/Boards/E621ImageFlags.cs b/Booru.Net/Models/Boards/E621ImageFlags.cs
new file mode 100644
index 0000000..5839b19
--- /dev/null
+++ b/Booru.Net/Models/Boards/E621ImageFlags.cs
@@ -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; }
+ }
+}
diff --git a/Booru.Net/Models/Boards/E621ImageSource.cs b/Booru.Net/Models/Boards/E621ImageSource.cs
new file mode 100644
index 0000000..335fee8
--- /dev/null
+++ b/Booru.Net/Models/Boards/E621ImageSource.cs
@@ -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; }
+ }
+}