Skip to content

Commit

Permalink
Consistent thumbnail display for updated page list.
Browse files Browse the repository at this point in the history
  • Loading branch information
impworks committed Mar 24, 2024
1 parent e4f53e1 commit 7829f25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
height: 48px;
border-radius: 100%;
background-size: cover;
background-position: center center;
}
}

Expand Down
17 changes: 11 additions & 6 deletions src/Bonsai/Areas/Front/Logic/PagePresenterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,17 @@ public async Task<InfoBlockVM> GetPageInfoBlockAsync(Page page)
/// </summary>
public async Task<IReadOnlyList<PageTitleExtendedVM>> GetLastUpdatedPagesAsync(int count)
{
return await _db.Pages
.Where(x => !x.IsDeleted)
.OrderByDescending(x => x.LastUpdateDate)
.Take(count)
.ProjectToType<PageTitleExtendedVM>(_mapper.Config)
.ToListAsync();
var list = await _db.Pages
.Where(x => !x.IsDeleted)
.OrderByDescending(x => x.LastUpdateDate)
.Take(count)
.ProjectToType<PageTitleExtendedVM>(_mapper.Config)
.ToListAsync();

foreach (var elem in list)
elem.MainPhotoPath = MediaPresenterService.GetSizedMediaPath(elem.MainPhotoPath, MediaSize.Small);

return list;
}

#endregion
Expand Down

0 comments on commit 7829f25

Please sign in to comment.