mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 13:52:28 +00:00
Fix favouritePlaylists logic
This commit is contained in:
parent
a15ff2c886
commit
2217c20803
1 changed files with 2 additions and 4 deletions
|
@ -210,10 +210,8 @@ public class ListController : ControllerBase
|
|||
int targetUserId = await this.database.Users.Where(u => u.Username == username).Select(u => u.UserId).FirstOrDefaultAsync();
|
||||
if (targetUserId == 0) return this.StatusCode(403, "");
|
||||
|
||||
IEnumerable<Playlist> heartedPlaylists = this.database.Playlists.Include(p => p.Creator).Where(p => p.CreatorId == targetUserId)
|
||||
.Skip(Math.Max(0, pageStart - 1))
|
||||
.Take(Math.Min(pageSize, 30))
|
||||
.AsEnumerable();
|
||||
IEnumerable<Playlist> heartedPlaylists = this.database.HeartedPlaylists.Where(p => p.UserId == targetUserId)
|
||||
.Include(p => p.Playlist).Include(p => p.Playlist.Creator).OrderByDescending(p => p.HeartedPlaylistId).Select(p => p.Playlist);
|
||||
|
||||
string response = heartedPlaylists.Aggregate(string.Empty, (current, p) => current + p.Serialize());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue