Artwork caching (sorta)
This commit is contained in:
commit
c8985c806b
2 changed files with 24 additions and 17 deletions
|
@ -228,7 +228,10 @@
|
||||||
"darkModeSupport": true,
|
"darkModeSupport": true,
|
||||||
"target": [
|
"target": [
|
||||||
"dmg"
|
"dmg"
|
||||||
]
|
],
|
||||||
|
"extendInfo": {
|
||||||
|
"NSUserNotificationAlertStyle": "alert"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,33 +44,37 @@ export default class playbackNotifications {
|
||||||
'text': 'Next'
|
'text': 'Next'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
toastXml: `<toast>
|
toastXml: `
|
||||||
<visual>
|
<toast>
|
||||||
<binding template="ToastGeneric">
|
<visual>
|
||||||
<text id="1">${a.name ?? ''}</text>
|
<binding template="ToastText02">
|
||||||
<text id="2">${a.artistName ?? ''} - ${a.albumName ?? ''}</text>
|
<text id="1">${a?.name.replace(/&/g, '&')}</text>
|
||||||
</binding>
|
<text id="2">${a?.artistName.replace(/&/g, '&')} — ${a?.albumName.replace(/&/g, '&')}</text>
|
||||||
</visual>
|
</binding>
|
||||||
<actions>
|
</visual>
|
||||||
<action content="Play/Pause" activationType="protocol" arguments="cider://playpause/"/>
|
<actions>
|
||||||
<action content="Next" activationType="protocol" arguments="cider://nextitem/"/>
|
<action content="Play/Pause" activationType="protocol" arguments="cider://playpause/"/>
|
||||||
</actions>
|
<action content="Next" activationType="protocol" arguments="cider://nextitem/"/>
|
||||||
</toast>`
|
</actions>
|
||||||
|
</toast>`
|
||||||
});
|
});
|
||||||
|
|
||||||
this._notification.on('click', (event: any) => {
|
// image implementation in windows toasts
|
||||||
|
//<image id="1" src="path to image" alt="img"/>
|
||||||
|
|
||||||
|
this._notification.on('click', (_: any) => {
|
||||||
this._utils.getWindow().show()
|
this._utils.getWindow().show()
|
||||||
this._utils.getWindow().focus()
|
this._utils.getWindow().focus()
|
||||||
})
|
})
|
||||||
|
|
||||||
this._notification.on('close', (event: any) => {
|
this._notification.on('close', (_: any) => {
|
||||||
this._notification = undefined;
|
this._notification = undefined;
|
||||||
})
|
})
|
||||||
|
|
||||||
this._notification.on('action', (event: any, action: any) => {
|
this._notification.on('action', (event: any, action: any) => {
|
||||||
if (action === 'Play/Pause') {
|
if (action === 0) {
|
||||||
this._utils.playback.playPause()
|
this._utils.playback.playPause()
|
||||||
} else if (action === 'Next') {
|
} else if (action === 1) {
|
||||||
this._utils.playback.next()
|
this._utils.playback.next()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue