Discussion:
[PATCH] allow filtering by albumartist
Johannes Weißl
2011-09-13 01:35:28 UTC
Permalink
keys are "albumartist" (long) and "~A" (short)
---
Doc/cmus.txt | 6 +++---
expr.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Doc/cmus.txt b/Doc/cmus.txt
index 381176c..cb5d975 100644
--- a/Doc/cmus.txt
+++ b/Doc/cmus.txt
@@ -1144,13 +1144,13 @@ built-in filters. Also (and)-grouping is done implicitly.
@h2 Strings

@li long
-*filename*, *artist*, *album*, *title*, *genre*, *comment*, *codec*,
-*codec_profile*
+*filename*, *artist*, *albumartist*, *album*, *title*, *genre*, *comment*,
+*codec*, *codec_profile*
@br
Comparators: *=* and *!=* (not equal)

@li short
-*~f*, *~a*, *~l*, *~t*, *~g*, *~c*
+*~f*, *~a*, *~A*, *~l*, *~t*, *~g*, *~c*
@br
Comparators: none

diff --git a/expr.c b/expr.c
index 5b48868..cc680ab 100644
--- a/expr.c
+++ b/expr.c
@@ -402,6 +402,7 @@ static const struct {
char short_key;
const char *long_key;
} map_short2long[] = {
+ { 'A', "albumartist" },
{ 'D', "discnumber" },
{ 'T', "tag", },
{ 'a', "artist" },
@@ -422,6 +423,7 @@ static const struct {
enum expr_type type;
} builtin[] = {
{ "album", EXPR_STR },
+ { "albumartist",EXPR_STR },
{ "artist", EXPR_STR },
{ "bitrate", EXPR_INT },
{ "codec", EXPR_STR },
@@ -831,7 +833,7 @@ unsigned int expr_get_match_type(struct expr *expr)
}

key = expr->key;
- if (strcmp(key, "artist") == 0)
+ if (strcmp(key, "artist") == 0 || strcmp(key, "albumartist") == 0)
return TI_MATCH_ARTIST;
if (strcmp(key, "album") == 0 || strcmp(key, "discnumber") == 0)
return TI_MATCH_ALBUM;
--
1.7.6
Gregory Petrosyan
2011-09-26 07:16:15 UTC
Permalink
Post by Johannes Weißl
keys are "albumartist" (long) and "~A" (short)
---
Doc/cmus.txt | 6 +++---
expr.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
Merged, thanks!

Gregory

Loading...