Skip to content

Commit

Permalink
allow filtering by albumartist
Browse files Browse the repository at this point in the history
keys are "albumartist" (long) and "~A" (short)
  • Loading branch information
weisslj authored and flyingmutant committed Sep 26, 2011
1 parent 1bc47d1 commit bb41709
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Doc/cmus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ static const struct {
char short_key;
const char *long_key;
} map_short2long[] = {
{ 'A', "albumartist" },
{ 'D', "discnumber" },
{ 'T', "tag", },
{ 'a', "artist" },
Expand All @@ -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 },
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bb41709

Please sign in to comment.