by onkel_enno » Tue Apr 05, 2022 11:24 pm
Ok, Thanks.
Adding this to a actions_add.js replaces the "Find more from" context menu. How can I ADD the entry to window.uitools.findMoreMenuActions?
Code: Select all
(() => {
window.uitools.findMoreMenuActions = {
albumartist: {
getMenuItems: function (track, collection) {
var type;
if (collection)
type = collection.getType();
var sA = track.albumArtist.split(';').map((a) => (a.trim()));
var retval = [];
sA.forEach(function (a) {
retval.push({
title: function () {
if (inArray(type, ['video', 'tv']))
return _('Director') + ': ' + a;
else
return _('Album Artist') + ': ' + a;
},
noAccessKey: true,
visible: function () {
return (!!a);
},
icon: 'artist',
execute: function () {
uitools.globalSettings.showingOnline = (track.id === -2); // online mode only for online source track
if (inArray(type, ['video', 'tv']))
navigationHandlers['director'].navigate(a, collection);
else
navigationHandlers['albumartist'].navigate(a, collection);
},
order: 21
})
});
return retval;
}
}
};
})();
Maybe this topic can be moved to the scripts forum.
Ok, Thanks.
Adding this to a actions_add.js replaces the "Find more from" context menu. How can I ADD the entry to window.uitools.findMoreMenuActions?
[code]
(() => {
window.uitools.findMoreMenuActions = {
albumartist: {
getMenuItems: function (track, collection) {
var type;
if (collection)
type = collection.getType();
var sA = track.albumArtist.split(';').map((a) => (a.trim()));
var retval = [];
sA.forEach(function (a) {
retval.push({
title: function () {
if (inArray(type, ['video', 'tv']))
return _('Director') + ': ' + a;
else
return _('Album Artist') + ': ' + a;
},
noAccessKey: true,
visible: function () {
return (!!a);
},
icon: 'artist',
execute: function () {
uitools.globalSettings.showingOnline = (track.id === -2); // online mode only for online source track
if (inArray(type, ['video', 'tv']))
navigationHandlers['director'].navigate(a, collection);
else
navigationHandlers['albumartist'].navigate(a, collection);
},
order: 21
})
});
return retval;
}
}
};
})();
[/code]
Maybe this topic can be moved to the scripts forum.