diff --git a/src/apply_rule.zig b/src/apply_rule.zig index 6c03b38..4f99ca9 100644 --- a/src/apply_rule.zig +++ b/src/apply_rule.zig @@ -61,7 +61,11 @@ pub fn applyScrobbleRule(allocator: std.mem.Allocator, scrobble: Data.ImportedSc }, .replace => switch (act.action_on) { inline .album, .track => |on| @field(output_scrobble, @tagName(on)) = act.action_txt, - inline .artists_album, .artists_track => |on| @field(output_scrobble, @tagName(on)) = &[_][]const u8{act.action_txt}, + inline .artists_album, .artists_track => |on| { + const artist = try allocator.alloc([]const u8, 1); + artist[0] = act.action_txt; + @field(output_scrobble, @tagName(on)) = artist; + }, }, } } diff --git a/src/main.zig b/src/main.zig index 1cab920..cdc9bca 100644 --- a/src/main.zig +++ b/src/main.zig @@ -14,10 +14,13 @@ pub const jetzig_options = struct { // htmx middleware skips layouts when `HX-Target` header is present and issues // `HX-Redirect` instead of a regular HTTP redirect when `request.redirect` is called. jetzig.middleware.HtmxMiddleware, - // Demo middleware included with new projects. Remove once you are familiar with Jetzig's - // middleware system. + // Demo middleware included with new projects. Remove once you are familiar with Jetzig's + // middleware system. }; + // This is currently the largest number of parameters one can have in a rule + pub const max_multipart_form_fields = 42; + // Maximum bytes to allow in request body. pub const max_bytes_request_body: usize = std.math.pow(usize, 2, 24);