public ImageCacherObject(DapiImageObject obj, DapiSearchType type) { if (type == DapiSearchType.Danbooru && !Uri.IsWellFormedUriString(obj.FileUrl, UriKind.Absolute)) { this.FileUrl = "https://danbooru.donmai.us" + obj.FileUrl; } else { this.FileUrl = obj.FileUrl.StartsWith("http", StringComparison.InvariantCulture) ? obj.FileUrl : "https:" + obj.FileUrl; } this.SearchType = type; this.Rating = obj.Rating; this.Tags = new HashSet <string>((obj.Tags ?? obj.TagString).Split(' ')); }
public ImageCacherObject(DapiImageObject obj, DapiSearchType type) { if (type == DapiSearchType.Danbooru) { this.FileUrl = "https://danbooru.donmai.us" + obj.File_Url; } else { this.FileUrl = obj.File_Url.StartsWith("http") ? obj.File_Url : "https:" + obj.File_Url; } this.SearchType = type; this.Rating = obj.Rating; this.Tags = new HashSet <string>((obj.Tags ?? obj.Tag_String).Split(' ')); }