merge changes from metadata-rewrite branch
git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include "playlist.h"
|
||||
#include "ls.h"
|
||||
#include "directory.h"
|
||||
#include "tables.h"
|
||||
#include "volume.h"
|
||||
#include "path.h"
|
||||
#include "stats.h"
|
||||
@@ -32,6 +31,7 @@
|
||||
#include "audio.h"
|
||||
#include "buffer2array.h"
|
||||
#include "log.h"
|
||||
#include "dbUtils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -442,13 +442,41 @@ int handlePlaylistId(FILE * fp, unsigned int * permission,
|
||||
int handleFind(FILE * fp, unsigned int * permission, int argArrayLength,
|
||||
char ** argArray)
|
||||
{
|
||||
return findSongsIn(fp,NULL,argArray[1],argArray[2]);
|
||||
int ret;
|
||||
|
||||
LocateTagItem * item = newLocateTagItem(argArray[1], argArray[2]);
|
||||
|
||||
if(!item) {
|
||||
commandError(fp, ACK_ERROR_ARG, "\%s\" isn't recognized",
|
||||
argArray[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = findSongsIn(fp, NULL, item);
|
||||
|
||||
freeLocateTagItem(item);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int handleSearch(FILE * fp, unsigned int * permission, int argArrayLength,
|
||||
char ** argArray)
|
||||
{
|
||||
return searchForSongsIn(fp,NULL,argArray[1],argArray[2]);
|
||||
int ret;
|
||||
|
||||
LocateTagItem * item = newLocateTagItem(argArray[1], argArray[2]);
|
||||
|
||||
if(!item) {
|
||||
commandError(fp, ACK_ERROR_ARG, "\%s\" isn't recognized",
|
||||
argArray[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = searchForSongsIn(fp, NULL, item);
|
||||
|
||||
freeLocateTagItem(item);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int listHandleUpdate(FILE * fp, unsigned int * permission, int argArrayLength,
|
||||
@@ -585,10 +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);
|
||||
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,
|
||||
|
Reference in New Issue
Block a user