mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-14 17:21:28 +00:00
Fix LBP3 playlist editing
This commit is contained in:
parent
8376928a6c
commit
b0858448c8
1 changed files with 4 additions and 5 deletions
|
@ -64,7 +64,7 @@ public class CollectionController : ControllerBase
|
|||
{
|
||||
targetPlaylist.SlotIds = targetPlaylist.SlotIds.Where(s => s != slotId).ToArray();
|
||||
await this.database.SaveChangesAsync();
|
||||
return this.Ok(this.GetUserPlaylists(token.UserId));
|
||||
return this.Ok(await this.GetUserPlaylists(token.UserId));
|
||||
}
|
||||
|
||||
GamePlaylist? newPlaylist = await this.DeserializeBody<GamePlaylist>("playlist", "levels");
|
||||
|
@ -96,13 +96,12 @@ public class CollectionController : ControllerBase
|
|||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
return this.Ok(this.GetUserPlaylists(token.UserId));
|
||||
return this.Ok(await this.GetUserPlaylists(token.UserId));
|
||||
}
|
||||
|
||||
private async Task<PlaylistResponse> GetUserPlaylists(int userId)
|
||||
{
|
||||
List<GamePlaylist> playlists = await this.database.Playlists.Include(p => p.Creator)
|
||||
.Where(p => p.CreatorId == userId)
|
||||
List<GamePlaylist> playlists = await this.database.Playlists.Where(p => p.CreatorId == userId)
|
||||
.Select(p => GamePlaylist.CreateFromEntity(p))
|
||||
.ToListAsync();
|
||||
int total = this.database.Playlists.Count(p => p.CreatorId == userId);
|
||||
|
@ -140,7 +139,7 @@ public class CollectionController : ControllerBase
|
|||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
return this.Ok(await this.GetUserPlaylists(token.UserId));
|
||||
return this.Ok(GamePlaylist.CreateFromEntity(playlistEntity));
|
||||
}
|
||||
|
||||
[HttpGet("user/{username}/playlists")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue