public YanderePost(int postId, HtmlNode postNode, Json.Post postJson, string md5 = null) : base(postId, md5) { if (postNode == null) { throw new ArgumentNullException(nameof(postNode)); } if (postJson == null) { throw new ArgumentNullException(nameof(postJson)); } ParsePost(postNode, postJson); }
private void ParsePost(HtmlNode postNode, Json.Post postJson) { ParseTags(postNode); ParseStats(postJson); ParseIsDeleted(postNode); if (PostExistState == ExistState.Exist) { ParseNotes(postNode); ParsePools(postNode); } ParseRelations(postNode); }
private void ParseStats(Json.Post postJson) { this.PostedDateTime = DateTimeOffset.FromUnixTimeSeconds(postJson.created_at).DateTime; this.PostedUser = new User { Id = postJson.creator_id, Name = postJson.author }; this.Md5 = postJson.md5; this.ByteSize = postJson.file_size; this.ImageSize = new Size { Height = postJson.height, Width = postJson.width }; this.Source = postJson.source; ImageRating = GetRatingFromChar(postJson.rating); RatingSafeLevel = RatingSafeLevel.None; OriginalUrl = postJson.file_url; }