Use find() instead of where() for song/albums views and add artists to song view

I think this makes things faster, but I may just be comparing to the scrobbles view which is terribly slow
This commit is contained in:
mitteneer 2025-03-28 10:11:07 -04:00
parent 05e9c05742
commit 0522a023b5
4 changed files with 22 additions and 4 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(.{.date})
const query = jetzig.database.Query(.Scrobble).select(.{ .id, .date })
.include(.song, .{ .select = .{ .id, .name } })
.include(.album, .{ .select = .{ .id, .name } })
.include(.scrobbleartists, .{ .select = .{.artist_id} })