fix for add to library on nowplaying
This commit is contained in:
parent
7d648d0e76
commit
7ad11a436b
1 changed files with 30 additions and 8 deletions
|
@ -3568,22 +3568,32 @@ const app = new Vue({
|
|||
}
|
||||
},
|
||||
],
|
||||
items: [{
|
||||
"icon": "./assets/feather/list.svg",
|
||||
"name": app.getLz('action.addToPlaylist') + " ...",
|
||||
"action": function () {
|
||||
app.promptAddToPlaylist()
|
||||
}
|
||||
},
|
||||
items: [
|
||||
{
|
||||
"icon": "./assets/feather/plus.svg",
|
||||
"id": "addToLibrary",
|
||||
"name": app.getLz('action.addToLibrary') + " ...",
|
||||
"disabled": false,
|
||||
"disabled": true,
|
||||
"action": function () {
|
||||
app.addToLibrary(app.mk.nowPlayingItem.id);
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "removeFromLibrary",
|
||||
"icon": "./assets/feather/x-circle.svg",
|
||||
"name": app.getLz('action.removeFromLibrary'),
|
||||
"hidden": true,
|
||||
"action": function () {
|
||||
self.removeFromLibrary()
|
||||
}
|
||||
},
|
||||
{
|
||||
"icon": "./assets/feather/list.svg",
|
||||
"name": app.getLz('action.addToPlaylist') + " ...",
|
||||
"action": function () {
|
||||
app.promptAddToPlaylist()
|
||||
}
|
||||
},
|
||||
{
|
||||
"icon": "./assets/feather/radio.svg",
|
||||
"name": app.getLz('action.startRadio'),
|
||||
|
@ -3636,6 +3646,18 @@ const app = new Vue({
|
|||
}
|
||||
this.showMenuPanel(menus[useMenu], event)
|
||||
|
||||
try {
|
||||
let result = await this.inLibrary([this.mk.nowPlayingItem])
|
||||
if (result[0].attributes.inLibrary) {
|
||||
menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true
|
||||
menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false
|
||||
} else {
|
||||
menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false
|
||||
}
|
||||
} catch (e) {
|
||||
e = null
|
||||
}
|
||||
|
||||
try {
|
||||
let rating = await app.getRating(app.mk.nowPlayingItem)
|
||||
if (rating == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue