im over this
This commit is contained in:
parent
5d45295e6e
commit
96be648c8e
4 changed files with 14 additions and 7 deletions
|
@ -1183,11 +1183,6 @@ export class BrowserWindow {
|
||||||
app.quit();
|
app.quit();
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('before-quit', () => {
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
ipcMain.on('play', (_event, type, id) => {
|
ipcMain.on('play', (_event, type, id) => {
|
||||||
BrowserWindow.win.webContents.executeJavaScript(`
|
BrowserWindow.win.webContents.executeJavaScript(`
|
||||||
MusicKit.getInstance().setQueue({ ${type}: '${id}', parameters : {l : app.mklang}}).then(function(queue) {
|
MusicKit.getInstance().setQueue({ ${type}: '${id}', parameters : {l : app.mklang}}).then(function(queue) {
|
||||||
|
|
|
@ -134,6 +134,7 @@ export class Store {
|
||||||
"scrobble_after": 50,
|
"scrobble_after": 50,
|
||||||
"filter_loop": false,
|
"filter_loop": false,
|
||||||
"filter_types": {},
|
"filter_types": {},
|
||||||
|
"remove_featured": false,
|
||||||
"secrets": {
|
"secrets": {
|
||||||
"username": "",
|
"username": "",
|
||||||
"key": ""
|
"key": ""
|
||||||
|
|
|
@ -22,7 +22,7 @@ const MusicKitInterop = {
|
||||||
ipcRenderer.send('wsapi-updatePlaybackState', attributes);
|
ipcRenderer.send('wsapi-updatePlaybackState', attributes);
|
||||||
// lastfm call
|
// lastfm call
|
||||||
if (app.mk.currentPlaybackProgress === (app.cfg.connectivity.lastfm.scrobble_after / 100)) {
|
if (app.mk.currentPlaybackProgress === (app.cfg.connectivity.lastfm.scrobble_after / 100)) {
|
||||||
attributes.primaryArtist = app.cfg.connectivity.lastfm.enabled ? await this.fetchPrimaryArtist(attributes.artistName) : attributes.artistName;
|
attributes.primaryArtist = (app.cfg.connectivity.lastfm.enabled && app.cfg.connectivity.lastfm.remove_featured) ? await this.fetchPrimaryArtist(attributes.artistName) : attributes.artistName;
|
||||||
ipcRenderer.send('lastfm:scrobbleTrack', attributes);
|
ipcRenderer.send('lastfm:scrobbleTrack', attributes);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -36,7 +36,7 @@ const MusicKitInterop = {
|
||||||
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
||||||
console.debug('[cider:preload] nowPlayingItemDidChange')
|
console.debug('[cider:preload] nowPlayingItemDidChange')
|
||||||
const attributes = MusicKitInterop.getAttributes()
|
const attributes = MusicKitInterop.getAttributes()
|
||||||
attributes.primaryArtist = app.cfg.connectivity.lastfm.enabled ? await this.fetchPrimaryArtist(attributes.artistName) : attributes.artistName;
|
attributes.primaryArtist = (app.cfg.connectivity.lastfm.enabled && app.cfg.connectivity.lastfm.remove_featured) ? await this.fetchPrimaryArtist(attributes.artistName) : attributes.artistName;
|
||||||
|
|
||||||
if (MusicKitInterop.filterTrack(attributes, false, true)) {
|
if (MusicKitInterop.filterTrack(attributes, false, true)) {
|
||||||
global.ipcRenderer.send('nowPlayingItemDidChange', attributes);
|
global.ipcRenderer.send('nowPlayingItemDidChange', attributes);
|
||||||
|
|
|
@ -1062,6 +1062,17 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="md-option-line" v-show="app.cfg.connectivity.lastfm.enabled">
|
||||||
|
<div class="md-option-segment">
|
||||||
|
{{$root.getLz('settings.option.connectivity.lastfmScrobble.removeFeatured')}}
|
||||||
|
</div>
|
||||||
|
<div class="md-option-segment md-option-segment_auto">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" v-model="app.cfg.connectivity.lastfm.remove_featured"
|
||||||
|
switch/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="md-option-line" v-show="app.cfg.connectivity.lastfm.enabled">
|
<div class="md-option-line" v-show="app.cfg.connectivity.lastfm.enabled">
|
||||||
<div class="md-option-segment">
|
<div class="md-option-segment">
|
||||||
{{$root.getLz('settings.option.connectivity.lastfmScrobble.filterTypes')}}
|
{{$root.getLz('settings.option.connectivity.lastfmScrobble.filterTypes')}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue