changed contextmenu on now playing
This commit is contained in:
parent
56d859cbd0
commit
0adeb0f7a5
1 changed files with 57 additions and 45 deletions
|
@ -2979,6 +2979,48 @@ const app = new Vue({
|
||||||
items: []
|
items: []
|
||||||
},
|
},
|
||||||
normal: {
|
normal: {
|
||||||
|
headerItems: [
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/heart.svg",
|
||||||
|
"id": "love",
|
||||||
|
"name": "Love",
|
||||||
|
"hidden": false,
|
||||||
|
"disabled": true,
|
||||||
|
"action": function () {
|
||||||
|
app.love(self.item)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/heart.svg",
|
||||||
|
"id": "unlove",
|
||||||
|
"active": true,
|
||||||
|
"name": "Unlove",
|
||||||
|
"hidden": true,
|
||||||
|
"action": function () {
|
||||||
|
app.unlove(self.item)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/thumbs-down.svg",
|
||||||
|
"id": "dislike",
|
||||||
|
"name": "Dislike",
|
||||||
|
"hidden": false,
|
||||||
|
"disabled": true,
|
||||||
|
"action": function () {
|
||||||
|
app.dislike(self.item)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/thumbs-down.svg",
|
||||||
|
"id": "undo_dislike",
|
||||||
|
"name": "Undo dislike",
|
||||||
|
"active": true,
|
||||||
|
"hidden": true,
|
||||||
|
"action": function () {
|
||||||
|
app.unlove(self.item)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
"icon": "./assets/feather/list.svg",
|
"icon": "./assets/feather/list.svg",
|
||||||
|
@ -2997,42 +3039,6 @@ const app = new Vue({
|
||||||
// if (!isLibrary) {app.addToLibrary(item_id); this.mk.nowPlayingItem.attributes.playParams["isLibrary"] = true} else { app.removeFromLibrary(data_type,item_id); this.mk.nowPlayingItem.attributes.playParams["isLibrary"] = false};
|
// if (!isLibrary) {app.addToLibrary(item_id); this.mk.nowPlayingItem.attributes.playParams["isLibrary"] = true} else { app.removeFromLibrary(data_type,item_id); this.mk.nowPlayingItem.attributes.playParams["isLibrary"] = false};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"icon": "./assets/feather/heart.svg",
|
|
||||||
"id": "love",
|
|
||||||
"name": "Love",
|
|
||||||
"disabled": true,
|
|
||||||
"action": function () {
|
|
||||||
app.love(app.mk.nowPlayingItem)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"icon": "./assets/feather/unheart.svg",
|
|
||||||
"id": "unlove",
|
|
||||||
"name": "Unlove",
|
|
||||||
"disabled": true,
|
|
||||||
"action": function () {
|
|
||||||
app.unlove(app.mk.nowPlayingItem)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"icon": "./assets/feather/thumbs-down.svg",
|
|
||||||
"id": "dislike",
|
|
||||||
"name": "Dislike",
|
|
||||||
"disabled": true,
|
|
||||||
"action": function () {
|
|
||||||
app.dislike(app.mk.nowPlayingItem)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"icon": "./assets/feather/x-circle.svg",
|
|
||||||
"id": "undo_dislike",
|
|
||||||
"name": "Undo dislike",
|
|
||||||
"disabled": true,
|
|
||||||
"action": function () {
|
|
||||||
app.unlove(app.mk.nowPlayingItem)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"icon": "./assets/feather/radio.svg",
|
"icon": "./assets/feather/radio.svg",
|
||||||
"name": "Start Radio",
|
"name": "Start Radio",
|
||||||
|
@ -3062,17 +3068,23 @@ const app = new Vue({
|
||||||
// }else{
|
// }else{
|
||||||
// menus.normal.items.find(x => x.id == "addToLibrary").disabled = true
|
// menus.normal.items.find(x => x.id == "addToLibrary").disabled = true
|
||||||
// }
|
// }
|
||||||
|
this.showMenuPanel(menus[useMenu], event)
|
||||||
|
|
||||||
|
try{
|
||||||
|
let rating = await app.getRating(app.mk.nowPlayingItem)
|
||||||
|
if (rating == 0) {
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'love').disabled = false
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'dislike').disabled = false
|
||||||
|
} else if (rating == 1) {
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'unlove').hidden = false
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'love').hidden = true
|
||||||
|
} else if (rating == -1) {
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'undo_dislike').hidden = false
|
||||||
|
menus.normal.headerItems.find(x => x.id == 'dislike').hidden = true
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
|
||||||
let rating = await app.getRating(app.mk.nowPlayingItem)
|
|
||||||
if (rating == 0) {
|
|
||||||
menus.normal.items.find(x => x.id == 'love').disabled = false
|
|
||||||
menus.normal.items.find(x => x.id == 'dislike').disabled = false
|
|
||||||
} else if (rating == 1) {
|
|
||||||
menus.normal.items.find(x => x.id == 'unlove').disabled = false
|
|
||||||
} else if (rating == -1) {
|
|
||||||
menus.normal.items.find(x => x.id == 'undo_dislike').disabled = false
|
|
||||||
}
|
}
|
||||||
CiderContextMenu.Create(event, menus[useMenu])
|
|
||||||
},
|
},
|
||||||
LastFMDeauthorize() {
|
LastFMDeauthorize() {
|
||||||
ipcRenderer.invoke('setStoreValue', 'lastfm.enabled', false).catch((e) => console.error(e));
|
ipcRenderer.invoke('setStoreValue', 'lastfm.enabled', false).catch((e) => console.error(e));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue