@@ -60,6 +60,9 @@ public class ImgData
6060
6161public static class Util
6262{
63+ public static int ThreadPerPage = 50 ;
64+ public static int PostsPerPage = 50 ;
65+
6366 public static string GetDuration ( DateTime current , DateTime date ) {
6467 TimeSpan dur = current - date ;
6568 return dur . Days switch
@@ -92,8 +95,8 @@ public static string GetThreadRow(int index) {
9295 . Threads
9396 . Where ( thread => thread . Creator . Text == user )
9497 . OrderByDescending ( each => each . TotalPosts )
95- . Skip ( ( page - 1 ) * 50 )
96- . Take ( 50 )
98+ . Skip ( ThreadPerPage * ( page - 1 ) )
99+ . Take ( ThreadPerPage )
97100 ;
98101 }
99102
@@ -102,11 +105,24 @@ public static string GetThreadRow(int index) {
102105 . Posts
103106 . Where ( posts => posts . Creator . Text == user )
104107 // .OrderByDescending(each => each.Id)
105- . Skip ( ( page - 1 ) * 50 )
106- . Take ( 50 )
108+ . Skip ( PostsPerPage * ( page - 1 ) )
109+ . Take ( PostsPerPage )
107110 ;
108111 }
109-
112+
113+ public static IEnumerable < Parsers . Thread > GetArchivedThreads ( ComicvineContext context , int page ) {
114+ return context
115+ . Threads
116+ . OrderByDescending ( t => t . Id )
117+ . Skip ( ThreadPerPage * ( page - 1 ) )
118+ . Take ( ThreadPerPage )
119+ ;
120+ }
121+
122+ public static int GetThreadsMaxPage ( ComicvineContext context ) {
123+ return context . Threads . Count ( ) / ThreadPerPage + 1 ;
124+ }
125+
110126 public static string GetHighlightClass ( ViewDataDictionary viewData , string expected ) {
111127 if ( expected == ( string ) ( viewData [ Keys . Highlight ] ?? "" ) ) {
112128 return "nav-item nav-highlight" ;
0 commit comments