aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbUtils.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-11 02:59:16 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-11 02:59:16 +0000
commitd6a87f538d2347cd4610962a0004052c0c6ba8de (patch)
tree3bc0d5b0f93eb14d520f37607eec51fe456aafd0 /src/dbUtils.c
parent4ec3df033954d01663087011efecfca37749f965 (diff)
downloadmpd-d6a87f538d2347cd4610962a0004052c0c6ba8de.tar.gz
mpd-d6a87f538d2347cd4610962a0004052c0c6ba8de.tar.xz
mpd-d6a87f538d2347cd4610962a0004052c0c6ba8de.zip
ok, now song->url is only the filename, not the full path to the song
git-svn-id: https://svn.musicpd.org/mpd/trunk@2602 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/dbUtils.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c
index 55791653f..3699ab72a 100644
--- a/src/dbUtils.c
+++ b/src/dbUtils.c
@@ -277,6 +277,17 @@ int sumSavedMemoryInDirectory(FILE * fp, Directory * dir, void * data) {
*sum += (strlen(dir->utf8name)+1-sizeof(Directory *))*
dir->songs->numberOfNodes;
+
+ /**sum += (strlen(dir->utf8name)+1)*
+ dir->subDirectories->numberOfNodes;*/
+
+ return 0;
+}
+
+int sumSavedMemoryInSong(FILE * fp, Song * song, void * data) {
+ int * sum = data;
+
+ *sum += strlen(song->url)+1;
return 0;
}
@@ -284,8 +295,8 @@ int sumSavedMemoryInDirectory(FILE * fp, Directory * dir, void * data) {
void printSavedMemoryFromFilenames() {
int sum;
- traverseAllIn(stderr, NULL, NULL, sumSavedMemoryInDirectory,
- (void *)&sum);
+ traverseAllIn(stderr, NULL, sumSavedMemoryInSong,
+ sumSavedMemoryInDirectory, (void *)&sum);
DEBUG("saved memory from filenames: %i\n", sum);
}