Fix limit on rule parameters and fix segfault in applyScrobbleRule
For sure this time
This commit is contained in:
parent
18d4df0a5c
commit
01fe10f045
2 changed files with 10 additions and 3 deletions
|
|
@ -61,7 +61,11 @@ pub fn applyScrobbleRule(allocator: std.mem.Allocator, scrobble: Data.ImportedSc
|
||||||
},
|
},
|
||||||
.replace => switch (act.action_on) {
|
.replace => switch (act.action_on) {
|
||||||
inline .album, .track => |on| @field(output_scrobble, @tagName(on)) = act.action_txt,
|
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;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,13 @@ pub const jetzig_options = struct {
|
||||||
// htmx middleware skips layouts when `HX-Target` header is present and issues
|
// 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.
|
// `HX-Redirect` instead of a regular HTTP redirect when `request.redirect` is called.
|
||||||
jetzig.middleware.HtmxMiddleware,
|
jetzig.middleware.HtmxMiddleware,
|
||||||
// Demo middleware included with new projects. Remove once you are familiar with Jetzig's
|
// Demo middleware included with new projects. Remove once you are familiar with Jetzig's
|
||||||
// middleware system.
|
// 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.
|
// Maximum bytes to allow in request body.
|
||||||
pub const max_bytes_request_body: usize = std.math.pow(usize, 2, 24);
|
pub const max_bytes_request_body: usize = std.math.pow(usize, 2, 24);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue