Add spotify renderer

This commit is contained in:
Dominic Grimm 2025-06-21 21:09:08 +02:00
parent 16fd5b0b95
commit b55c3a666f
Signed by: dergrimm
SSH key fingerprint: SHA256:0uoWpcqOtkyvQ+ZqBjNYiDqIZY+9s8VeZkkJ/4ryB4E
17 changed files with 1464 additions and 22 deletions

View file

@ -116,7 +116,7 @@ pub fn render(self: *const Self, efa_dm_resp: *const api.efa.models.DmResponse,
const escaped_context = try context.escape(arena.allocator());
var tmp_file = try temp.TempFile.create(arena.allocator(), .{
.pattern = "departures-*.html",
.pattern = "render-departures-*.html",
});
defer tmp_file.deinit();
const path = try tmp_file.parent_dir.realpathAlloc(arena.allocator(), tmp_file.basename);
@ -124,7 +124,7 @@ pub fn render(self: *const Self, efa_dm_resp: *const api.efa.models.DmResponse,
const file = try tmp_file.open(.{ .mode = .write_only });
defer file.close();
const writer = file.writer();
try template.render(&escaped_context, writer);
try template.render(&escaped_context, writer.any());
}
return try renderer.render(self.allocator, path, self.dimensions);