updating_db in status and some ideas for the TODO that i've already forgotten
git-svn-id: https://svn.musicpd.org/mpd/trunk@669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
5798500b85
commit
4cfd77be95
1
TODO
1
TODO
|
@ -9,6 +9,7 @@
|
||||||
h) when reading directory db and checking for deleted, new, or changed stuff, assume all info is sorted (so we can deterimine if its new very quickly without searching through lists of stuff every time). Also, for new stuff, insert it with insertInListBeforeNode() function, to keep lists sorted.
|
h) when reading directory db and checking for deleted, new, or changed stuff, assume all info is sorted (so we can deterimine if its new very quickly without searching through lists of stuff every time). Also, for new stuff, insert it with insertInListBeforeNode() function, to keep lists sorted.
|
||||||
j) when reading new directory db, we should block some signals when manipulating the directorydb, so we don't receive a signal to quit in the middle of an update
|
j) when reading new directory db, we should block some signals when manipulating the directorydb, so we don't receive a signal to quit in the middle of an update
|
||||||
k) when bg-update, have parent print out new old stuff to log on reading db, not the child
|
k) when bg-update, have parent print out new old stuff to log on reading db, not the child
|
||||||
|
l) return a job-id for each update-job, the job id can be polled in status
|
||||||
|
|
||||||
2) rewrite interface stuff, specifically command list handling etc so its less of a hack and deals with the above update stuff better
|
2) rewrite interface stuff, specifically command list handling etc so its less of a hack and deals with the above update stuff better
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@
|
||||||
#define COMMAND_STATUS_ERROR "error"
|
#define COMMAND_STATUS_ERROR "error"
|
||||||
#define COMMAND_STATUS_CROSSFADE "xfade"
|
#define COMMAND_STATUS_CROSSFADE "xfade"
|
||||||
#define COMMAND_STATUS_AUDIO "audio"
|
#define COMMAND_STATUS_AUDIO "audio"
|
||||||
|
#define COMMAND_STATUS_UPDATING_DB "updating_db"
|
||||||
|
|
||||||
typedef int (* CommandHandlerFunction)(FILE *, unsigned int *, int, char **);
|
typedef int (* CommandHandlerFunction)(FILE *, unsigned int *, int, char **);
|
||||||
|
|
||||||
|
@ -193,6 +194,8 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
|
||||||
myfprintf(fp,"%s: %u:%i:%i\n",COMMAND_STATUS_AUDIO,getPlayerSampleRate(),getPlayerBits(),getPlayerChannels());
|
myfprintf(fp,"%s: %u:%i:%i\n",COMMAND_STATUS_AUDIO,getPlayerSampleRate(),getPlayerBits(),getPlayerChannels());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isUpdatingDB()) myfprintf(fp,"%s: 1\n",COMMAND_STATUS_UPDATING_DB);
|
||||||
|
|
||||||
if(getPlayerError()!=PLAYER_ERROR_NOERROR) {
|
if(getPlayerError()!=PLAYER_ERROR_NOERROR) {
|
||||||
myfprintf(fp,"%s: %s\n",COMMAND_STATUS_ERROR,getPlayerErrorStr());
|
myfprintf(fp,"%s: %s\n",COMMAND_STATUS_ERROR,getPlayerErrorStr());
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,11 @@ void deleteEmptyDirectoriesInDirectory(Directory * directory);
|
||||||
|
|
||||||
int addSubDirectoryToDirectory(Directory * directory, char * shortname, char * name);
|
int addSubDirectoryToDirectory(Directory * directory, char * shortname, char * name);
|
||||||
|
|
||||||
|
int isUpdatingDB() {
|
||||||
|
if(directory_updatePid>0) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void directory_sigChldHandler(int pid, int status) {
|
void directory_sigChldHandler(int pid, int status) {
|
||||||
if(directory_updatePid==pid) {
|
if(directory_updatePid==pid) {
|
||||||
if(WIFSIGNALED(status) && WTERMSIG(status)!=SIGTERM) {
|
if(WIFSIGNALED(status) && WTERMSIG(status)!=SIGTERM) {
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
extern char directorydb[MAXPATHLEN+1];
|
extern char directorydb[MAXPATHLEN+1];
|
||||||
|
|
||||||
|
int isUpdatingDB();
|
||||||
|
|
||||||
void directory_sigChldHandler(int pid, int status);
|
void directory_sigChldHandler(int pid, int status);
|
||||||
|
|
||||||
int updateInit(FILE * fp);
|
int updateInit(FILE * fp);
|
||||||
|
|
Loading…
Reference in New Issue