Only select necessary columns in artists/albums/songs views

Some guy on GitHub said this is better lol
This commit is contained in:
mitteneer 2025-03-28 09:47:07 -04:00
parent 43e07901d6
commit 05e9c05742
4 changed files with 17 additions and 6 deletions

View file

@ -4,7 +4,7 @@ const jetzig = @import("jetzig");
pub fn index(request: *jetzig.Request) !jetzig.View {
var root = try request.data(.object);
var scrobbles_view = try root.put("scrobbles", .array);
const query = jetzig.database.Query(.Scrobble).select(.{})
const query = jetzig.database.Query(.Scrobble).select(.{.date})
.include(.song, .{ .select = .{ .id, .name } })
.include(.album, .{ .select = .{ .id, .name } })
.include(.scrobbleartists, .{ .select = .{.artist_id} })