Page 1 of 1

Clean Up the database

PostPosted: Thu Feb 07, 2013 3:13 pm
by ph0b0s101
Hi,

i have started using MucisCabinet and i love the idea behind the mod but i have a problem with my database. A short background. I have a upload folder locaded were all my music is:

\\music\mp3\incoming\

My friend uploaded me a ton of new music which is badly tagged. Anyway this is not the best place to store media which wasn't touched before. Therefore i have changed my configuration so that there isn't a upload folder anymore. I have did many database refreshes but the data from the previously uploaded media is still in the database and i have no idea how i can clean up the database from this "wrong" data. Without the MusicCabinet Mod installed, there was an button in the settings where i could clean the database but now i have only three different database update buttons (offline, normal, full). But none of them seems to delete the wrong data. The files aren't longer in the old path \\music\mp3\incoming, they were moved outside the mp3 folder to a place which is no member of one of the defined musicfolders.

In the file-based browsing all is right.

I would be grateful if somebody could help me with my problem.

best regards
ph0b0s

Re: Clean Up the database

PostPosted: Fri Feb 08, 2013 8:59 pm
by hakko
Can you try adding \\music\mp3\incoming as a media folder, do an offline scan, and then delete it as a media folder? The deleting should force an expunge of all files in that directory from the database.

Re: Clean Up the database

PostPosted: Sat Feb 09, 2013 12:13 am
by rubbersoul
I just had to do what hakko mentioned the other day and it fixed my (your) problem.

Re: Clean Up the database

PostPosted: Sun Feb 10, 2013 10:20 am
by ph0b0s101
Thank you for your answer @hakko & rubbersoul. I have a question to your suggestion, before I will try it.

What you mean with "adding as a media folder"? In the settings tab i could only add "music folders" and hit the indexed button or not.

Furthermore i want to try to understand how the database cleaning works. As i have wrote in the start post, i have moved the \\music\mp3\incoming folder in the filesystem to an other place. Since i have moved the folder i have renamed the folder and have tagged songs, renamed album folders and so on. So i could not imagine that adding the "new" and changed folder will pruge all failed entries in the database.

best regards

Edit: I have noticed that under the menu point "File tree" there are two entries (mp3 and incoming). Why is the incoming folder here to see, when there are no music folder with this name exists in the settings tab for music folders?

Re: Clean Up the database

PostPosted: Sun Feb 10, 2013 3:27 pm
by rubbersoul
go to settings > media folders > and in the "add media folder" box enter a name and the old path you want to delete (keep the index button checked). then press the save button below.

once the old folder is saved to the folder list, uncheck the index box by it and check the delete box instead. then press save again.

you may need to do a scan in between there and/or after, I can't remember.

Re: Clean Up the database

PostPosted: Mon Feb 11, 2013 2:29 pm
by ph0b0s101
Ok, i have tried to follow your instrucktions but without success. But the discriped process works but it seems that i have a buggy database. I have delete all my indexed folders from the mediafolders tab, but i have 1503 songs in the database, which is exactly the amount of songs which where in the incoming folder. So now i need a short how to how i can delete this songs from the db, before i can add the media folders again.

@hakko: there are a simple solution for me? i have no problem, if i have to rebuild the db, but i need instructions to do this :-)

best regards
ph0b0s

Re: Clean Up the database

PostPosted: Mon Feb 11, 2013 4:18 pm
by hakko
Did this really not work? "Can you try adding \\music\mp3\incoming as a media folder, do an offline scan, and then delete it as a media folder?"

The problem here is that only media folders are scanned, and fully deleted from the db when removed. The incoming folder is not part of that routine. A scan of it is forced whenever someone uploads new data to it, but not as part of the normal scanning, and I'm not actually sure what happens if it has been removed etc.

That is obviously a flaw (I never use the upload function so I haven't noticed), and that's why adding it as a media folder, scanning, and deleting it as a media folder should work.

If it doesn't and you really want to get rid of those files, you could connect to your PostgreSQL database and issue the SQL command "truncate library.directory cascade". That will totally remove what files the database is aware of from your collection.

Regards