Page 1 of 1

Duplicate content fixer

Posted: Sun Nov 10, 2024 7:11 pm
by whipdancer
I would like to create an add-on to consolidate tracks found in the Files to Edit \ Duplicate Content list. I don't see a specific dialog for it or Files to Edit.

Can anyone point me to instructions/overview on figuring out how to determine when I'm looking at that list?

Also, according to the Wiki, I can enable developer mode under Help > About. I can't find anything there that allows me to enable developer mode. Am I missing something?

I appreciate any guidance.

Re: Duplicate content fixer

Posted: Mon Nov 11, 2024 2:57 pm
by Peke
Hi,
Use latest debug build from https://www.mediamonkey.com/forum/viewt ... 86639&sd=d

and Image should contain Developer mode.

Then you can easily use Chrome Developer console to temper with MM

Re: Duplicate content fixer

Posted: Mon Nov 11, 2024 3:47 pm
by whipdancer
Thank you. That's quite helpful.

Re: Duplicate content fixer

Posted: Wed Nov 13, 2024 11:26 pm
by whipdancer
I've been going through the debug logs for MM5, trying to pick up on how to identify the "Files to Edit>Duplicate Content" node.

I ran across this in the debug log file:

Code: Select all

TreeView.setNodePath FROM root/collection:-1/filestoedit:-1/files_to_edit_duplicate_content:duplicate_content-1 TO root/collection:-1/filestoedit:-1/files_to_edit_duplicate_content:duplicate_content-1

Code: Select all

00024102	163.40045166	[20212] MM5 [27388](R) getNodeHandlerState(NODE_HANDLERS_STATE_COLLECTION_-1|files_to_edit_duplicate_content): {"viewAsId":"contentGroupedTracklist","baseViewType":"list"}
I've found where is performing the query to match songs.

I can't figure out how I would identify when it has the main view - assuming that's the best approach. Basically, I want to add a "Consolidate" button to the groupedListView when it is the Duplicate content view.

Unless there's a more reasonable way to approach the problem?

Thanks,
Whip

Re: Duplicate content fixer

Posted: Thu Nov 14, 2024 2:42 pm
by Ludek
The best way for your script is to modify the nodeHandler for the node in question,
e.g.

Code: Select all

nodeHandlers.files_to_edit_duplicate_content = inheritNodeHandler('FilesToEditDuplicateContent', 'FilesToEditDefault', {
    tooltip: _('This node finds all content for which tracks have duplicate hashes or fingerprints.'),
    customizable: false,
    collapseSupport: false,
    viewAs: ['contentGroupedTracklist'],
    defaultColumnSort: 'none', // to respect order served by content
});
change to

Code: Select all

nodeHandlers.files_to_edit_duplicate_content = inheritNodeHandler('FilesToEditDuplicateContent', 'FilesToEditDefault', {
    tooltip: _('This node finds all content for which tracks have duplicate hashes or fingerprints.'),
    customizable: false,
    collapseSupport: false,
    viewAs: ['myContentGroupedTracklist'],
    defaultColumnSort: 'none', // to respect order served by content
});
And then you can (re)define /controls/myContentGroupedTracklist.js with ancestor of contentGroupedTracklist

Re: Duplicate content fixer

Posted: Thu Nov 14, 2024 8:03 pm
by whipdancer
Awesome, thanks for the info.