protected AdvancedSearchResult(string keyword, Category category, AdvancedSearchOptions advancedSearch) : base(keyword, category) { _AdvSearchData = advancedSearch is null ? new AdvancedSearchOptions() : advancedSearch.Clone(); SearchUri = _AdvSearchData == default ? base.SearchUri : new Uri(base.SearchUri.OriginalString + getQueryString()); }
private AdvancedSearchResult(string keyword, Category category, AdvancedSearchOptions advancedSearch) : base(keyword, category) { if (advancedSearch != null) { this.advSearchData = advancedSearch.Data; } this.SearchUri = this.advSearchData == default(ushort) ? base.SearchUri : new Uri(base.SearchUri.OriginalString + getQueryString()); }
private string getQueryString() { var adv = new AdvancedSearchOptions(this.advSearchData); return($"&advsearch=1" + $"{(adv.SkipMasterTags ? "&skip_mastertags=1" : "")}" + $"{(adv.SearchName ? "&f_sname=1" : "")}" + $"{(adv.SearchTags ? "&f_stags=1" : "")}" + $"{(adv.SearchDescription ? "&f_sdesc=1" : "")}" + $"{(adv.SearchTorrentFilenames ? "&f_storr=1" : "")}" + $"{(adv.GalleriesWithTorrentsOnly ? "&f_sto=1" : "")}" + $"{(adv.SearchLowPowerTags ? "&f_sdt1=1" : "")}" + $"{(adv.SearchDownvotedTags ? "&f_sdt2=1" : "")}" + $"{(adv.ShowExpungedGalleries ? "&f_sh=1" : "")}" + $"{(adv.SearchMinimumRating ? "&f_sr=1&f_srdd=" + adv.MinimumRating.ToString() : "")}"); }
internal static AdvancedSearchResult Search(string keyword, Category category, AdvancedSearchOptions advancedSearch) { return(new AdvancedSearchResult(keyword, category, advancedSearch)); }
private WatchedSearchResult(string keyword, Category category, AdvancedSearchOptions advancedSearch) : base(keyword, category, advancedSearch) { SearchUri = new Uri(SearchBaseUri, base.SearchUri.Query); }