aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/directory.c5
-rw-r--r--src/tagTracker.c10
-rw-r--r--src/tagTracker.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/directory.c b/src/directory.c
index 5ac94c534..443c8bfba 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -32,6 +32,7 @@
#include "mpd_types.h"
#include "sig_handlers.h"
#include "player.h"
+#include "tagTracker.h"
#include <string.h>
#include <sys/types.h>
@@ -1000,6 +1001,8 @@ int writeDirectoryDB() {
while(fclose(fp) && errno==EINTR);
+ sortTagTrackerInfo();
+
return 0;
}
@@ -1088,6 +1091,8 @@ int readDirectoryDB() {
if(stat(directory_db,&st)==0) directory_dbModTime = st.st_mtime;
+ sortTagTrackerInfo();
+
return 0;
}
diff --git a/src/tagTracker.c b/src/tagTracker.c
index 56480167b..cea02f471 100644
--- a/src/tagTracker.c
+++ b/src/tagTracker.c
@@ -93,3 +93,13 @@ void printMemorySavedByTagTracker() {
DEBUG("saved memory: %li\n", (long)sum);
}
+
+void sortTagTrackerInfo() {
+ int i;
+
+ for(i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
+ if(!tagLists[i]) continue;
+
+ sortList(tagLists[i]);
+ }
+}
diff --git a/src/tagTracker.h b/src/tagTracker.h
index f7c007fe7..fcafde736 100644
--- a/src/tagTracker.h
+++ b/src/tagTracker.h
@@ -11,4 +11,6 @@ int getNumberOfTagItems(int type);
void printMemorySavedByTagTracker();
+void sortTagTrackerInfo();
+
#endif