Move Scrobble rule application to upload.zig

They couldn't see the changes made by rules after uploading Scrobbles which made it seem like the rules weren't being applied. Also makes Album rules easier to apply I believe.
This commit is contained in:
mitteneer 2025-04-21 16:41:40 -04:00
parent 87a2fe2d34
commit 77170a1e28
4 changed files with 23 additions and 14 deletions

View file

@ -12,7 +12,7 @@ pub fn applyScrobbleRule(scrobble: Scrobble, rules: Rules) Scrobble {
inline else => |on| match_found = match_found and std.mem.eql(u8, @field(scrobble, @tagName(on)), cond.match_txt),
},
.contains => switch (cond.match_on) {
inline else => |on| match_found = match_found and (std.mem.count(u8, @field(scrobble, @tagName(on)), cond.match_txt) > 0),
inline else => |on| match_found = match_found and std.mem.containsAtLeast(u8, @field(scrobble, @tagName(on)), 1, cond.match_txt),
},
}
}