Skip to content

Commit a659ffd

Browse files
committed
top users stats taking too much time
1 parent b5bd6be commit a659ffd

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

VinePlus.Web/Pages/Queries.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,6 @@ public static IEnumerable<PostSummary> searchUserPosts(ComicvineContext context,
315315
;
316316
}
317317

318-
public static IEnumerable<ProfilePostView> getPostViews(ComicvineContext context) {
319-
return context
320-
.Posts
321-
.GroupBy(post => post.Creator.Text)
322-
.OrderByDescending(group => group.Count())
323-
.Take(10)
324-
.Select(x => new ProfilePostView(x.Key, x.Count()));
325-
}
326318

327319
public static IEnumerable<BoardView> getBoardsViews(ComicvineContext context) {
328320
return context

VinePlus.Web/Pages/Stats/Index.cshtml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,7 @@
2626
</span>
2727
}
2828
</div>
29-
<div class="mini-heading">Top users</div>
30-
<div class="user-container" >
31-
<span class="thread-odd thread-item thread-header thread-item-title">User</span>
32-
<span class="thread-odd thread-item thread-header thread-item-posts"># Posts</span>
33-
@foreach (var (index, threadPosted) in Model.top_users.Select((t, i) => (i,t))) {
34-
<span class="@Url.Content($"{Helpers.getThreadRow(index)} thread-item thread-item-title")">
35-
<a href="@Url.Content($"/profile/{threadPosted.username}")">
36-
@threadPosted.username
37-
</a>
38-
</span>
39-
<span class="@Url.Content($"{Helpers.getThreadRow(index)} thread-item thread-item-posts")">
40-
@threadPosted.no_posts
41-
</span>
42-
}
43-
</div>
29+
4430
<div class="mini-heading">Boards summary</div>
4531
<div class="user-container" >
4632
<span class="thread-odd thread-item thread-header thread-item-title">Board</span>

VinePlus.Web/Pages/Stats/Index.cshtml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ namespace VinePlus.Web.Pages.Stats;
66
public class Index(ComicvineContext context) : PageModel
77
{
88
public IEnumerable<ThreadView> top_threads;
9-
public IEnumerable<ProfilePostView> top_users;
109
public IEnumerable<BoardView> board_summary;
1110
public int total_threads;
1211
public int total_posts;
1312

1413
public void OnGet() {
1514
top_threads = Queries.getArchivedThreads(context, 1, SortForumBy.NoPosts).Take(10);
16-
top_users = [];//Queries.getPostViews(context);
1715
total_posts = Queries.getTotalPosts(context);
1816
total_threads = Queries.getTotalThreads(context);
1917
board_summary = Queries.getBoardsViews(context);

0 commit comments

Comments
 (0)