clean up logging for creating and updating the db
git-svn-id: https://svn.musicpd.org/mpd/trunk@235 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
efa083c887
commit
1459ee22fe
@ -117,6 +117,7 @@ void removeSongFromDirectory(Directory * directory, char * shortname) {
|
|||||||
void * song;
|
void * song;
|
||||||
|
|
||||||
if(findInList(directory->songs,shortname,&song)) {
|
if(findInList(directory->songs,shortname,&song)) {
|
||||||
|
LOG("removing: %s\n",((Song *)song)->utf8file);
|
||||||
removeASongFromTables((Song *)song);
|
removeASongFromTables((Song *)song);
|
||||||
deleteASongFromPlaylist((Song *)song);
|
deleteASongFromPlaylist((Song *)song);
|
||||||
deleteFromList(directory->songs,shortname);
|
deleteFromList(directory->songs,shortname);
|
||||||
@ -148,7 +149,6 @@ int updateInDirectory(Directory * directory, char * shortname, char * name) {
|
|||||||
|
|
||||||
if((mtime = isMusic(name))) {
|
if((mtime = isMusic(name))) {
|
||||||
if(0==findInList(directory->songs,shortname,&song)) {
|
if(0==findInList(directory->songs,shortname,&song)) {
|
||||||
LOG("adding %s\n",name);
|
|
||||||
addToDirectory(directory,shortname,name);
|
addToDirectory(directory,shortname,name);
|
||||||
}
|
}
|
||||||
else if(mtime>((Song *)song)->mtime) {
|
else if(mtime>((Song *)song)->mtime) {
|
||||||
@ -205,10 +205,12 @@ int removeDeletedFromDirectory(Directory * directory) {
|
|||||||
tmpNode = node->nextNode;
|
tmpNode = node->nextNode;
|
||||||
if(findInList(entList,node->key,&name)) {
|
if(findInList(entList,node->key,&name)) {
|
||||||
if(!isDir((char *)name)) {
|
if(!isDir((char *)name)) {
|
||||||
|
LOG("removing directory: %s\n",(char*)name);
|
||||||
deleteFromList(directory->subDirectories,node->key);
|
deleteFromList(directory->subDirectories,node->key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
LOG("removing directory: %s\n",(char*)name);
|
||||||
deleteFromList(directory->subDirectories,node->key);
|
deleteFromList(directory->subDirectories,node->key);
|
||||||
}
|
}
|
||||||
node = tmpNode;
|
node = tmpNode;
|
||||||
@ -286,7 +288,7 @@ int exploreDirectory(Directory * directory) {
|
|||||||
DEBUG("explore: attempting to opendir: %s\n",dirname);
|
DEBUG("explore: attempting to opendir: %s\n",dirname);
|
||||||
if((dir = opendir(rmp2amp(utf8ToFsCharset(dirname))))==NULL) return -1;
|
if((dir = opendir(rmp2amp(utf8ToFsCharset(dirname))))==NULL) return -1;
|
||||||
|
|
||||||
LOG("explore: %s\n",dirname);
|
DEBUG("explore: %s\n",dirname);
|
||||||
while((ent = readdir(dir))) {
|
while((ent = readdir(dir))) {
|
||||||
if(ent->d_name[0]=='.') continue; /* hide hidden stuff */
|
if(ent->d_name[0]=='.') continue; /* hide hidden stuff */
|
||||||
|
|
||||||
@ -325,6 +327,7 @@ int addToDirectory(Directory * directory, char * shortname, char * name) {
|
|||||||
return addSubDirectoryToDirectory(directory,shortname,name);
|
return addSubDirectoryToDirectory(directory,shortname,name);
|
||||||
}
|
}
|
||||||
else if(isMusic(name)) {
|
else if(isMusic(name)) {
|
||||||
|
LOG("adding %s\n",name);
|
||||||
Song * song;
|
Song * song;
|
||||||
song = addSongToList(directory->songs,shortname,name);
|
song = addSongToList(directory->songs,shortname,name);
|
||||||
if(!song) return -1;
|
if(!song) return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user