Fix api bugs
This commit is contained in:
+3
-3
@@ -663,7 +663,7 @@ namespace Tesses.YouTubeDownloader2025Companion
|
||||
if (!ctx.QueryParams.TryGetFirstInt64("count", out var count))
|
||||
count = 20;
|
||||
using (var db = new Database())
|
||||
await ctx.WithMimeType("application/json").SendJsonAsync((await db.GetArtistsAsync(q, offset, count)).ToList());
|
||||
await ctx.WithMimeType("application/json").SendJsonAsync((await db.GetArtistsAsync(q, offset * count, count)).ToList());
|
||||
}
|
||||
|
||||
private static async Task ApiArtist(ServerContext ctx)
|
||||
@@ -682,7 +682,7 @@ namespace Tesses.YouTubeDownloader2025Companion
|
||||
await ctx.WithMimeType("application/json").SendJsonAsync(
|
||||
new
|
||||
{
|
||||
Albums = (await db.GetAlbumsFromArtistAsync(artistId.ToString(), q, offset, count)).ToList(),
|
||||
Albums = (await db.GetAlbumsFromArtistAsync(artistId.ToString(), q, offset * count, count)).ToList(),
|
||||
ArtistName = (await db.GetArtistAsync(artistId.ToString()))?.ArtistName ?? ""
|
||||
}
|
||||
);
|
||||
@@ -735,7 +735,7 @@ namespace Tesses.YouTubeDownloader2025Companion
|
||||
count = 20;
|
||||
|
||||
using (var db = new Database())
|
||||
await ctx.WithMimeType("application/json").SendJsonAsync((await db.GetAlbumsAsync(q, offset * 20, count)).ToList());
|
||||
await ctx.WithMimeType("application/json").SendJsonAsync((await db.GetAlbumsAsync(q, offset * count, count)).ToList());
|
||||
}
|
||||
private static async Task ApiAlbum(ServerContext ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user