private PostData GetRandomCollabPost(string[] searchTerms, MySqlConnection conn) { PostData pd = RandomCollabPost(searchTerms, conn); AdditionalPostData apd = BuildAdditionalPostData(searchTerms, conn); pd.AdditionalData = apd; return(pd); }
private PostData PreviousCollabPost(string[] searchTerms, int currentId, MySqlConnection conn) { List <int> commonLinkIds = GetCommonLinkIds(searchTerms, conn).ToList(); commonLinkIds.Sort(); int idIndex = commonLinkIds.IndexOf(currentId); int previousIndex = idIndex == 0 ? idIndex : idIndex - 1; string postQuery = BuildPostQuery(_postQuery, TagParser.EscapeApostrophe(searchTerms[0]), commonLinkIds[previousIndex]); PostData pd = GetPostForQuery(postQuery, conn); AdditionalPostData apd = BuildAdditionalPostData(searchTerms, conn); pd.PostIndex = previousIndex; pd.PostCount = commonLinkIds.Count(); pd.AdditionalData = apd; return(pd); }