My understanding was that you are about to develop such a addon and are asking how to do it?
Feel free to expand my sample above.
Note that node.dataSource is the Playlist object:
https://www.mediamonkey.com/docs/api/cl ... ylist.html
So to exclude auto-playlists use code like this:
Code: Select all
MediaTree.prototype.override({
initialize: function ($super, rootElem, params) {
$super(rootElem, params);
this.checkboxes = true;
},
bindData: function ($super, div, index) {
$super(div, index);
var node = this.dataSource.getNodeByIndex(index);
var playlist;
if (node && node.handlerID == 'playlist' && !node.dataSource.isAutoPlaylist) {
playlist = node.dataSource;
node.checked = true; // LS: this sets the checked state
}
if (div.check && !playlist)
div.check.style.display = 'none' // set display = 'none' so that the checkbox does not take any space
}
});
But it sounds to me that the functionality is redundant, because what you are looking for is already a native function in Properties > Classification > Playlists
EDIT: Alternativelly if you still wants this to be part of main panel then it might be better to introduce another component that will list the playlists without auto-playlists and not to be dependent on the Media Tree -- as clicking a Media Tree node currently also changes the view, which is unwaned in your scenario.