diff options
-rw-r--r-- | apps/tagcache.c | 13 | ||||
-rw-r--r-- | apps/tagcache.h | 7 | ||||
-rw-r--r-- | apps/tagtree.c | 4 | ||||
-rw-r--r-- | docs/CREDITS | 1 |
4 files changed, 21 insertions, 4 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 4c324c8da3..87810da93b 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -588,7 +588,12 @@ static bool check_against_clause(long numeric, const char *str, | |||
588 | return numeric == clause->numeric_data; | 588 | return numeric == clause->numeric_data; |
589 | else | 589 | else |
590 | return !strcasecmp(clause->str, str); | 590 | return !strcasecmp(clause->str, str); |
591 | 591 | case clause_is_not: | |
592 | if (clause->numeric) | ||
593 | return numeric != clause->numeric_data; | ||
594 | else | ||
595 | return strcasecmp(clause->str, str); | ||
596 | |||
592 | case clause_gt: | 597 | case clause_gt: |
593 | return numeric > clause->numeric_data; | 598 | return numeric > clause->numeric_data; |
594 | case clause_gteq: | 599 | case clause_gteq: |
@@ -600,10 +605,16 @@ static bool check_against_clause(long numeric, const char *str, | |||
600 | 605 | ||
601 | case clause_contains: | 606 | case clause_contains: |
602 | return (strcasestr(str, clause->str) != NULL); | 607 | return (strcasestr(str, clause->str) != NULL); |
608 | case clause_not_contains: | ||
609 | return (strcasestr(str, clause->str) == NULL); | ||
603 | case clause_begins_with: | 610 | case clause_begins_with: |
604 | return (strcasestr(str, clause->str) == str); | 611 | return (strcasestr(str, clause->str) == str); |
612 | case clause_not_begins_with: | ||
613 | return (strcasestr(str, clause->str) != str); | ||
605 | case clause_ends_with: /* Not supported yet */ | 614 | case clause_ends_with: /* Not supported yet */ |
606 | return false; | 615 | return false; |
616 | case clause_not_ends_with: /* Not supported yet */ | ||
617 | return false; | ||
607 | } | 618 | } |
608 | 619 | ||
609 | return false; | 620 | return false; |
diff --git a/apps/tagcache.h b/apps/tagcache.h index b27d804792..e43414cba5 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h | |||
@@ -71,9 +71,10 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title, | |||
71 | #define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */ | 71 | #define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */ |
72 | #define FLAG_DIRTYNUM 0x0004 /* Numeric data has been modified */ | 72 | #define FLAG_DIRTYNUM 0x0004 /* Numeric data has been modified */ |
73 | 73 | ||
74 | enum clause { clause_none, clause_is, clause_gt, clause_gteq, clause_lt, | 74 | enum clause { clause_none, clause_is, clause_is_not, clause_gt, clause_gteq, |
75 | clause_lteq, clause_contains, clause_begins_with, clause_ends_with }; | 75 | clause_lt, clause_lteq, clause_contains, clause_not_contains, |
76 | enum modifiers { clause_mod_none, clause_mod_not }; | 76 | clause_begins_with, clause_not_begins_with, clause_ends_with, |
77 | clause_not_ends_with }; | ||
77 | 78 | ||
78 | struct tagcache_stat { | 79 | struct tagcache_stat { |
79 | bool initialized; /* Is tagcache currently busy? */ | 80 | bool initialized; /* Is tagcache currently busy? */ |
diff --git a/apps/tagtree.c b/apps/tagtree.c index daa52646fa..0565b62981 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -176,13 +176,17 @@ static int get_clause(int *condition) | |||
176 | 176 | ||
177 | MATCH(condition, buf, "=", clause_is); | 177 | MATCH(condition, buf, "=", clause_is); |
178 | MATCH(condition, buf, "==", clause_is); | 178 | MATCH(condition, buf, "==", clause_is); |
179 | MATCH(condition, buf, "!=", clause_is_not); | ||
179 | MATCH(condition, buf, ">", clause_gt); | 180 | MATCH(condition, buf, ">", clause_gt); |
180 | MATCH(condition, buf, ">=", clause_gteq); | 181 | MATCH(condition, buf, ">=", clause_gteq); |
181 | MATCH(condition, buf, "<", clause_lt); | 182 | MATCH(condition, buf, "<", clause_lt); |
182 | MATCH(condition, buf, "<=", clause_lteq); | 183 | MATCH(condition, buf, "<=", clause_lteq); |
183 | MATCH(condition, buf, "~", clause_contains); | 184 | MATCH(condition, buf, "~", clause_contains); |
185 | MATCH(condition, buf, "!~", clause_not_contains); | ||
184 | MATCH(condition, buf, "^", clause_begins_with); | 186 | MATCH(condition, buf, "^", clause_begins_with); |
187 | MATCH(condition, buf, "!^", clause_not_begins_with); | ||
185 | MATCH(condition, buf, "$", clause_ends_with); | 188 | MATCH(condition, buf, "$", clause_ends_with); |
189 | MATCH(condition, buf, "!$", clause_not_ends_with); | ||
186 | 190 | ||
187 | return 0; | 191 | return 0; |
188 | } | 192 | } |
diff --git a/docs/CREDITS b/docs/CREDITS index 0b907024ce..4029cebe2a 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -223,3 +223,4 @@ Alexander Levin | |||
223 | Barry Wardell | 223 | Barry Wardell |
224 | Lars van de Klomp | 224 | Lars van de Klomp |
225 | Philippe Miossec | 225 | Philippe Miossec |
226 | Jochen Kemnade | ||