aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-10 21:48:08 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-10 21:48:08 +0000
commit021a0915c2bc6e62bda3e45a89c95266f3b2da47 (patch)
treec789eb800bfb04d5934728a327c5dd90c569e21c /src/command.c
parent0337ec851c643503afd2287f03ca42b5adf5cad7 (diff)
downloadmpd-021a0915c2bc6e62bda3e45a89c95266f3b2da47.tar.gz
mpd-021a0915c2bc6e62bda3e45a89c95266f3b2da47.tar.xz
mpd-021a0915c2bc6e62bda3e45a89c95266f3b2da47.zip
ok, list is now reimplemented, should be ready to go, this branch is now
compatible with trunk mpd again, time merge git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2587 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/command.c b/src/command.c
index 35045b472..5b3616a40 100644
--- a/src/command.c
+++ b/src/command.c
@@ -613,11 +613,35 @@ int handleClearError(FILE * fp, unsigned int * permission, int argArrayLength,
int handleList(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray)
{
- char * arg1 = NULL;
+ int numConditionals = 0;
+ LocateTagItem * conditionals = NULL;
+ int tagType = getLocateTagItemType(argArray[1]);
+ int ret;
- if(argArrayLength==3) arg1 = argArray[2];
- //return printAllKeysOfTable(fp,argArray[1],arg1);
- return 0;
+ if(tagType < 0) {
+ commandError(fp, ACK_ERROR_ARG,
+ "\"%s\" is not known", argArray[1]);
+ return -1;
+ }
+
+ /* for compatibility with < 0.12.0 */
+ if(argArrayLength==3) {
+ if(tagType != TAG_ITEM_ALBUM) {
+ commandError(fp, ACK_ERROR_ARG,
+ "should be \"%s\" for 3 arguments",
+ mpdTagItemKeys[TAG_ITEM_ALBUM]);
+ return -1;
+ }
+ conditionals = newLocateTagItem(mpdTagItemKeys[TAG_ITEM_ARTIST],
+ argArray[2]);
+ numConditionals = 1;
+ }
+
+ ret = listAllUniqueTags(fp, tagType, numConditionals,conditionals);
+
+ if(conditionals) free(conditionals);
+
+ return ret;
}
int handleMove(FILE * fp, unsigned int * permission, int argArrayLength,