-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nullforce-public/twibooru
Add support for Twibooru. Breaking: Namespace for Derpibooru/Philomena support
- Loading branch information
Showing
28 changed files
with
443 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/RepresentationJson.cs → src/Philomena/RepresentationJson.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class CommentJson : JsonBase | ||
{ | ||
[JsonPropertyName("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
[JsonPropertyName("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
|
||
[JsonPropertyName("hidden_from_users")] | ||
public bool HiddenFromUsers { get; set; } | ||
|
||
[JsonPropertyName("body")] | ||
public string Body { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class IntensitiesJson : JsonBase | ||
{ | ||
[JsonPropertyName("ne")] | ||
public double NE { get; set; } | ||
[JsonPropertyName("nw")] | ||
public double NW { get; set; } | ||
[JsonPropertyName("se")] | ||
public double SE { get; set; } | ||
[JsonPropertyName("sw")] | ||
public double SW { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class LocationJson : JsonBase | ||
{ | ||
[JsonPropertyName("id_at_location")] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("location")] | ||
public string Location { get; set; } | ||
|
||
[JsonPropertyName("url_at_location")] | ||
public string Url { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class PostJson : JsonBase | ||
{ | ||
[JsonPropertyName("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
[JsonPropertyName("deletion_reason")] | ||
public string DeletionReason { get; set; } | ||
|
||
[JsonPropertyName("duplicate_of")] | ||
public int DuplicateOf { get; set; } | ||
|
||
[JsonPropertyName("first_seen_at")] | ||
public DateTime FirstSeenAt { get; set; } | ||
|
||
[JsonPropertyName("hidden_from_users")] | ||
public bool HiddenFromUsers { get; set; } | ||
|
||
[JsonPropertyName("locations")] | ||
public LocationJson[] Locations { get; set; } | ||
|
||
/// <summary> | ||
/// The type of media associated with this post. One of "paste", "image". | ||
/// </summary> | ||
[JsonPropertyName("media_type")] | ||
public string MediaType { get; set; } | ||
|
||
[JsonPropertyName("orig_sha512_hash")] | ||
public string OriginalSHA512Hash { get; set; } | ||
|
||
[JsonPropertyName("processed")] | ||
public bool Processed { get; set; } | ||
|
||
[JsonPropertyName("sha512_hash")] | ||
public string SHA512Hash { get; set; } | ||
|
||
[JsonPropertyName("source_url")] | ||
public string SourceUrl { get; set; } | ||
|
||
[JsonPropertyName("tag_ids")] | ||
public int[] TagIds { get; set; } | ||
|
||
[JsonPropertyName("tags")] | ||
public string[] Tags { get; set; } | ||
|
||
[JsonPropertyName("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
|
||
// Non-hidden Post | ||
[JsonPropertyName("comment_count")] | ||
public int CommentCount { get; set; } | ||
|
||
[JsonPropertyName("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonPropertyName("downvotes")] | ||
public int Downvotes { get; set; } | ||
|
||
[JsonPropertyName("faves")] | ||
public int Favorites { get; set; } | ||
|
||
[JsonPropertyName("score")] | ||
public int Score { get; set; } | ||
|
||
[JsonPropertyName("size")] | ||
public long Size { get; set; } | ||
|
||
[JsonPropertyName("upvotes")] | ||
public int Upvotes { get; set; } | ||
|
||
[JsonPropertyName("wilson_score")] | ||
public double WilsonScore { get; set; } | ||
|
||
// Image Post | ||
[JsonPropertyName("animated")] | ||
public bool Animated { get; set; } | ||
|
||
[JsonPropertyName("aspect_ratio")] | ||
public double AspectRatio { get; set; } | ||
|
||
[JsonPropertyName("duration")] | ||
public double Duration { get; set; } | ||
|
||
/// <summary> | ||
/// The file extension of the image. One of "gif", "jpg", "jpeg", "png", "svg", "webm", "mp4". | ||
/// </summary> | ||
[JsonPropertyName("format")] | ||
public string Format { get; set; } | ||
|
||
[JsonPropertyName("height")] | ||
public int Height { get; set; } | ||
|
||
[JsonPropertyName("intensities")] | ||
public IntensitiesJson Intensities { get; set; } | ||
|
||
/// <summary> | ||
/// The MIME type of this image. One of "image/gif", "image/jpeg", "image/png", "image/svg+xml", "video/webm", "video/mp4". | ||
/// </summary> | ||
[JsonPropertyName("mime_type")] | ||
public string MimeType { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("representations")] | ||
public RepresentationsJson Representations { get; set; } | ||
|
||
[JsonPropertyName("thumbnails_generated")] | ||
public bool ThumbnailsGenerated { get; set; } | ||
|
||
[JsonPropertyName("view_url")] | ||
public string ViewUrl { get; set; } | ||
|
||
[JsonPropertyName("width")] | ||
public int Width { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class RepresentationsJson : JsonBase | ||
{ | ||
[JsonPropertyName("full")] | ||
public string Full { get; set; } | ||
[JsonPropertyName("large")] | ||
public string Large { get; set; } | ||
[JsonPropertyName("medium")] | ||
public string Medium { get; set; } | ||
[JsonPropertyName("small")] | ||
public string Small { get; set; } | ||
[JsonPropertyName("thumb")] | ||
public string Thumb { get; set; } | ||
[JsonPropertyName("thumb_small")] | ||
public string ThumbSmall { get; set; } | ||
[JsonPropertyName("thumb_tiny")] | ||
public string ThumbTiny { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
|
||
public class CommentResponseJson : JsonBase | ||
{ | ||
[JsonPropertyName("comments")] | ||
public CommentJson[] Comments { get; set; } | ||
} | ||
|
||
public class PostResponseJson : JsonBase | ||
{ | ||
[JsonPropertyName("post")] | ||
public PostJson Post { get; set; } | ||
} | ||
|
||
public class SearchPostsResponseJson : JsonBase | ||
{ | ||
[JsonPropertyName("posts")] | ||
public PostJson[] Posts { get; set; } | ||
|
||
[JsonPropertyName("total")] | ||
public int Total { get; set; } | ||
} | ||
|
||
public class SearchTagsResponseJson : JsonBase | ||
{ | ||
[JsonPropertyName("tags")] | ||
public TagJson[] Tags { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace Nullforce.Api.JsonModels.Twibooru; | ||
|
||
public class TagJson : JsonBase | ||
{ | ||
[JsonPropertyName("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("aliased_tag")] | ||
public string AliasedTag { get; set; } | ||
|
||
[JsonPropertyName("aliases")] | ||
public string[] Aliases { get; set; } | ||
|
||
/// <summary> | ||
/// The category class of this tag. One of "character", "content-fanmade", "content-official", "error", "oc", "origin", "rating", "species", "spoiler". | ||
/// </summary> | ||
[JsonPropertyName("category")] | ||
public string Category { get; set; } | ||
|
||
[JsonPropertyName("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonPropertyName("implied_by_tags")] | ||
public string[] ImpliedByTags { get; set; } | ||
|
||
[JsonPropertyName("implied_tags")] | ||
public string[] ImpliedTags { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("name_in_namespace")] | ||
public string NameInNamespace { get; set; } | ||
|
||
[JsonPropertyName("namespace")] | ||
public string Namespace { get; set; } | ||
|
||
[JsonPropertyName("posts")] | ||
public int PostCount { get; set; } | ||
|
||
[JsonPropertyName("short_description")] | ||
public string ShortDescription { get; set; } | ||
|
||
[JsonPropertyName("slug")] | ||
public string Slug { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletions
13
...Tests/Integration/DeserializationTests.cs → ...onModel.Tests/Philomena/PhilomenaTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.