Unfortunately, BOTH optimizations doesn't remove unused Genres. I checked it before the quick run, after the quick run and after the complete run with MM4 v1466. The number of 1232 genres in my MM.DB is unchanged!Bex wrote:I think Optimize Database (Quick) is sufficient to remove unused Genres, if not use Optimize Database (Complete).
The difference between Quick and Complete is explained here:
I'm sure that I have cleaned all my tracks with strange genres like '9' or '131' or wrong separated genres, like 'Dance-pop, Urban, Adult Contemporary, R&B, Pop'. In the Genre-Node, they don't appear anymore. UsageCount is 0.
In the issue 5110, jiri answers:
Could someone with the debug-version please check, if unused genres really should be cleaned? According to 5043 a similar issue should be fixed. I can not confirm this, just repeat the steps in the error description and you will see, the old genre will still be in the database. The usage counter is 0 for the old, and 1 for the new one.You can check the exact SQLs that are executed in the debug log, but there's not much interesting - just some consistency checks and SQLite's VACUUM.
I have no coding skills and therefore I can't understand the triggerlines in the table GENRES:
- Code: Select all
CREATE TRIGGER delete_GenresSongs DELETE ON GenresSongs
UPDATE Genres SET UsageCount=UsageCount-1 WHERE Genres.IDGenre=old.IDGenre;
DELETE FROM Genres WHERE Genres.IDGenre=old.IDGenre AND Genres.UsageCount=0;
I'm interested in a solution because every change of genres takes several seconds until I can choose from the drop-down box or type in a known genre. I hope to speed up this step with fewer entries.