Begin rule application

The more I think about this, the more I think it's gonna be super slow and bad. There must bve a good way of doing this, but I'm not sure how...
This commit is contained in:
mitteneer 2025-04-21 00:17:16 -04:00
parent baf9ef38a4
commit 445ca45fa9
3 changed files with 41 additions and 3 deletions

View file

@ -1,5 +1,3 @@
const zeit = @import("zeit");
pub const LastFMScrobble = struct {
track: []const u8,
artist: []const u8,
@ -36,3 +34,27 @@ pub const SpotifyScrobble = struct {
offline_timestamp: u64,
incognito_mode: ?bool,
};
const Rule = struct {
name: []const u8,
conditionals: []struct {
match_on: MatchOn,
match_cond: enum { is, contains },
match_txt: []const u8,
},
actions: []struct {
action: []const u8,
action_on: enum { is, contains },
action_txt: []const u8,
},
};
const Rules = struct {
rules: []const Rule,
};
const MatchOn = enum {
artist,
album,
song,
};