summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--mg_db.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index 6982c67..3f5eae8 100644
--- a/HISTORY
+++ b/HISTORY
@@ -370,3 +370,5 @@ how many different types of information the first line toggles in the player.
- Mysql only: Fix order of insertion into empty playlist. Found by Thomas
Balke.
- update README.* about MySQL with utf8
+- importing subdirectories with mugglei: sorting by folder did not work for
+ those tracks. Found by Thomas Balke.
diff --git a/mg_db.c b/mg_db.c
index 7c6a87d..9be504c 100644
--- a/mg_db.c
+++ b/mg_db.c
@@ -1166,13 +1166,6 @@ mgDb::SyncFile(const char *filename) {
mgDebug(2,"Importing %s",filename);
get_ID3v2_Tags(filename);
- char *folders[4];
- char *fbuf=SeparateFolders(filename,folders,4);
- mgSQLString c_folder1(folders[0]);
- mgSQLString c_folder2(folders[1]);
- mgSQLString c_folder3(folders[2]);
- mgSQLString c_folder4(folders[3]);
- free(fbuf);
mgSQLString c_artist("Unknown");
mgSQLString c_album("Unassigned");
mgSQLString c_title("Unknown");
@@ -1218,7 +1211,14 @@ mgDb::SyncFile(const char *filename) {
char *b;
msprintf(&b,"%s%s",relpath,cfilename);
mgSQLString c_mp3file(b);
+ char *folders[4];
+ char *fbuf=SeparateFolders(b,folders,4);
+ mgSQLString c_folder1(folders[0]);
+ mgSQLString c_folder2(folders[1]);
+ mgSQLString c_folder3(folders[2]);
+ mgSQLString c_folder4(folders[3]);
free(b);
+ free(fbuf);
sprintf(sql,"SELECT id from tracks WHERE mp3file=%s",c_mp3file.quoted());
string id = get_col0(sql);
if (id!="NULL") {