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))
|
if (!ctx.QueryParams.TryGetFirstInt64("count", out var count))
|
||||||
count = 20;
|
count = 20;
|
||||||
using (var db = new Database())
|
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)
|
private static async Task ApiArtist(ServerContext ctx)
|
||||||
@@ -682,7 +682,7 @@ namespace Tesses.YouTubeDownloader2025Companion
|
|||||||
await ctx.WithMimeType("application/json").SendJsonAsync(
|
await ctx.WithMimeType("application/json").SendJsonAsync(
|
||||||
new
|
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 ?? ""
|
ArtistName = (await db.GetArtistAsync(artistId.ToString()))?.ArtistName ?? ""
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -735,7 +735,7 @@ namespace Tesses.YouTubeDownloader2025Companion
|
|||||||
count = 20;
|
count = 20;
|
||||||
|
|
||||||
using (var db = new Database())
|
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)
|
private static async Task ApiAlbum(ServerContext ctx)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user