Fix header on artists/albums pages

I'm realizing what I have is extremely fragile, so not ideal, but not a bad starting place I would say
This commit is contained in:
mitteneer 2025-03-04 12:00:48 -05:00
parent a55f4e7bc0
commit 8a70239170
4 changed files with 6 additions and 7 deletions

View file

@ -16,8 +16,9 @@ pub fn index(request: *jetzig.Request) !jetzig.View {
}
pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View {
const album = try jetzig.database.Query(.Album).find(id).execute(request.repo);
var root = try request.data(.object);
try root.put("album_id", id);
try root.put("album", album.?.name);
var songs_view = try root.put("songs", .array);
const query = jetzig.database.Query(.Albumsong).include(.song, .{ .select = .{ .name, .id } }).join(.inner, .album).where(.{ .album = .{ .id = id } });
const songs = try request.repo.all(query);