Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post a reply

Visual Confirmation

To prevent automated access and spam, you are required to confirm that you are human. Please place a check mark next to all images of monkeys or apes. If you cannot see any images, please contact the Board Administrator.

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by greggw » Tue May 29, 2012 5:11 am

I was able to install Bex's script in MM4 and it did remove the unused genres. Thanks!

-- Gregg

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Lowlander » Mon May 28, 2012 9:16 pm

This addon still works and you can use File > Remove Unused > Genres

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by greggw » Mon May 28, 2012 7:16 pm

I'm using MediaMonkey 4.0.5.1491 and I can confirm that Optimize database (Quick) and Optimize database (Complete) do not remove unused Genres from some dialog boxes. For example, if I Edit a Collection and go to the Criteria tab and Add Search Criteria and select Genres as the Property, the resulting Values checklist contains genres that are not in my collection. Likewise if I create or edit an AutoPlaylist (Advanced) and add Genre as a Search Criteria, the Values checklist contains genres that are not in my collection. (When I say genres that are not in my collection, I mean that the genres do not appear in the Genre node for my entire music collection.)

Before I upgraded to MM4, I could use Bex's script to remove the Genres that are not in my collection from these checklist. Now that I'm using MM4, I don't know how to remove these genres.

-- greggw

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by MMuser2011 » Mon Jan 30, 2012 8:30 am

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:
http://www.ventismedia.com/mantis/view.php?id=5110
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!

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:
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.
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.

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
BEGIN
  UPDATE Genres SET UsageCount=UsageCount-1 WHERE Genres.IDGenre=old.IDGenre;
  DELETE FROM  Genres WHERE Genres.IDGenre=old.IDGenre AND Genres.UsageCount=0;
END;
Especially the 'old.IDGenre' is a mistery for me.

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.

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by elliottdp » Wed Nov 23, 2011 9:03 am

I have a new question regarding a variation of this problem and have not been able to figure it out.

I have used the removeunused genres. After restart however, two unused genres keep automatically popping up in the genre node, Hip Rap and Alternative.

I have genres Rap; Hip-Hop; Rock: Alternative; Rock: Hard and so on. Why would just Alternative keep generating?

Thanks

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Bex » Wed Jun 15, 2011 9:08 am

Thanks, glad you liked it!

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by elliottdp » Wed Jun 15, 2011 9:06 am

Heh.

I didn't see the link to download the installer. I must have just read right past it. I'm a little blind sometimes. :)

Anyway... Was able to get rid of 403 unused genres. Absolutely excellent script.
Thank you so much. Saved me a ton of annoying time scrolling through stupid genres (overly specific) like House Trance, DJ Club Dance, (148), etc.

I prefer just broad genres... Electronic, R&B, Jazz, Classical...

Thanks again.

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Bex » Wed Jun 15, 2011 1:49 am

Short explanation:
If the script contains "Sub OnStartup" then it's an autoscript.

Why didn't you just download the installer?

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by elliottdp » Tue Jun 14, 2011 5:57 pm

Thanks, Mizery Made.

Did not think to put it in the auto scripts folder. That did it.

Just for my knowledge and perhaps others, what determines whether a script goes in the auto folder or the scripts folder?

Thanks again.

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Mizery_Made » Tue Jun 14, 2011 1:12 pm

You haven't done things right, I don't think. I believe it should be "...Scripts\Auto\" and doesn't require an entry in the .ini. You should also find it under "File -> Remove Unused...", not "Tools -> Scripts -> Remove Unused...". Have you tried using the Install package provided in the first post?

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Guest » Tue Jun 14, 2011 12:37 pm

Hello.

I have MM version 3.25.1306. Windows Xp Pro.

I've copy and pasted Bex's script(have not changed it in the slightest) from above and I've created the .vbs filename necessary and notated the new script in the .ini file. Punctuation/capitalization and so on appears to match the other scripts I have.

The problem is when I select the Remove Unused from the Tools>Scripts pull down menu I get the following error:

Error #13-Microsoft VBScript runtime error
Type Mismatch: 'RemoveUnused'
File: "D:\MediaMonkey\Scripts\RemovedUnused.vbs"' Line: 1, Column: 0


Two things:
Not sure why the above error message specifies ...scripts\RemovedUnused.vbs... I named the file removeunused.vbs For yucks I then changed the .vbs file to removedunused.vbs, then got a message saying the file is not accessible. either being used or don't have admin access. hmmm???

I see that Bex has specified that it works in MM 3 Only in the post earlier. Does that mean it will work in any Version 3.xx.... or just in Version 3.00? Is this the problem?

or am I missing something? Help!

Here is my .ini file (Remove Unused is the last one listed):

Code: Select all
[Statistics]
FileName=Stats.vbs
ProcName=ShowStats
Order=1
DisplayName=&Statistics
Description=Library Statistics Report
Language=VBScript
ScriptType=1

[ExportHTML]
FileName=Export.vbs
ProcName=ExportHTML
Order=2
DisplayName=Track List (&HTML)
Description=Exports selected tracks to a .htm file
Language=VBScript
ScriptType=1

[ExportXML]
FileName=Export.vbs
ProcName=ExportXML
Order=3
DisplayName=Track List (&XML)
Description=Exports selected tracks to an .xml file
Language=VBScript
ScriptType=1

[ExportCSV]
FileName=Export.vbs
ProcName=ExportCSV
Order=4
DisplayName=Track List (CS&V)
Description=Exports selected tracks to a .csv file
Language=VBScript
ScriptType=1

[ExportXLS]
FileName=Export.vbs
ProcName=ExportXLS
Order=5
DisplayName=Track List (&Excel)
Description=Exports selected tracks to a .xls file
Language=VBScript
ScriptType=1

[AutoIncTrackN]
FileName=AutoIncTrackN.vbs
ProcName=AutoIncTrackNumbers
Order=6
DisplayName=Auto-&increment Track #s...
Description=Sequentially numbers Tracks
Language=VBScript
ScriptType=0

[SwapArtistTitle]
FileName=SwapArtistTitle.vbs
ProcName=SwapArtistTitle
Order=7
DisplayName=&Swap Artist and Title
Description=Swaps Artist and Title fields
Language=VBScript
ScriptType=0

[Case]
FileName=Case.vbs
ProcName=TitleCase
Order=8
DisplayName=Case Checker...
Description=Checks for correct capitalization
Language=VBScript
ScriptType=0

[ExportM3Us]
FileName=ExportM3Us.vbs
ProcName=ExportM3Us
Order=9
DisplayName=Export all Playlists...
Description=Exports all Playlists to .m3u
Language=VBScript
ScriptType=0

[ExportOPML]
FileName=ExportOPML.vbs
ProcName=ExportOPML
Order=10
DisplayName=Export subscribed Podcasts...
Description=Exports subscribed Podcasts to .opml file
Language=VBScript
ScriptType=0

[CustomReport]
Filename=CustomReport.vbs
Procname=CustomReport
Order=11
DisplayName=Custom Report
Description=Custom Report
Language=VBScript
ScriptType=1

[CustomReportAuto]
Filename=CustomReport.vbs
Procname=CustomReportAuto
Order=12
DisplayName=Custom Report Auto
Description=Custom Report with previous options
Language=VBScript
ScriptType=1

[JustListArtists]
Filename=JustListArtists.vbs
Procname=JustListArtists
Order=13
DisplayName=Just List Artists
Description=Just List Artists
Language=VBScript
ScriptType=1

[RemoveUnused]
Filename=RemoveUnused.vbs
Procname=RemoveUnused
Order=14
DisplayName=Remove Unused
Description=Remove unused properties, genres, etc.
Language=VBScript
ScriptType=0

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by smokiibear » Sun Feb 20, 2011 5:19 am

I'm using MM3.2 and attempting to remove unused genres with tehe optimize database (Complete), but the empty folders don't get deleted? Any ideas?

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Bex » Mon Feb 07, 2011 5:51 am

Mizery_Made is right and I removed the outdated MM2 information from the first post.

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:
http://www.ventismedia.com/mantis/view.php?id=5110

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by Mizery_Made » Mon Feb 07, 2011 3:18 am

I do believe that information is outdated. If you notice, that quote contains a reference to MS Access. MM2.x used that format for the database, while MM3 converted over to SQLite. I'm almost positive that handling of the genres changed between the two versions, with the ID3v1 genres no longer being "default genres" in MM3. In fact, I just started up MM3 with a clean DB (though a few files were scanned in automatically due to File Monitor) and only one genre was present (mind you, coming from the scanned files) suggesting to me that the "default genres" are no longer hard-coded into the program. Therefor, this script should remove any genre in your database that isn't currently in use (though as mentioned, MM appears to do this natively. I can't say... cause I cleaned out my genres years ago and haven't added any that later needed to be deleted), especially since the first post also states "- Changed script so all Unused Genres are removed".

Re: Remove Unused Genres/Classification 1.2.1 (2008-02-18)

Post by nightrocket » Mon Feb 07, 2011 2:23 am

Mizery_Made wrote:@nightrocket, I don't believe that's true. My database only has 8 genres in it, so obviously the "automatic/default" genres (or at least most of them) have been removed here. I don't recall if that was done by this script, or perhaps it was an SQL query from Bex prior to him writing this script.


Glad I'm not the only one up at this hour!

Mizery, here is a cut and paste of what I was referencing. It's from Bex first post in this string, at the bottom:

"Here's a small script which removes genres you don't use, from the dropdown list in the properties. Well, only custom made genres can be removed and not any of these listed here since they are part of ID3v1 specification. Removing any of those leads to unwanted strange behavior of genres in MM.
I have had this function as a query in MS Access for a while but I thought I should turn it into a script and share it with the community.Enjoy!/Bex."

Now, if you know how to erase ALL unused genres, I'm all ears. Anybody else know how to do it without "breaking" the program?

Peace.

Top