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:
parent
baf9ef38a4
commit
445ca45fa9
3 changed files with 41 additions and 3 deletions
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue