filter loop fixes
This commit is contained in:
parent
7850493c9e
commit
742e606c09
3 changed files with 14 additions and 4 deletions
|
@ -52,6 +52,11 @@ export default class lastfm {
|
||||||
this._authenticated = false;
|
this._authenticated = false;
|
||||||
console.debug('[lastfm] [disconnect] Disconnected')
|
console.debug('[lastfm] [disconnect] Disconnected')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this._utils.getIPCMain().on('lastfm:nowPlayingChange', (event: any, attributes: any) => {
|
||||||
|
if (this._utils.getStoreValue("lastfm.filter_loop")) return;
|
||||||
|
this.onNowPlayingItemDidChange(attributes)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,15 +128,18 @@ export default class lastfm {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private verifyTrack(attributes: any): object {
|
private verifyTrack(attributes: any): object {
|
||||||
if (!attributes) return {};
|
if (!attributes) return attributes;
|
||||||
|
|
||||||
if (!attributes.lfmAlbum) {
|
if (!attributes.lfmAlbum) {
|
||||||
|
console.log(attributes.artistName)
|
||||||
|
console.log(attributes.albumName)
|
||||||
return this._lfm.album.getInfo({
|
return this._lfm.album.getInfo({
|
||||||
"artist": attributes.artistName,
|
"artist": attributes.artistName,
|
||||||
"album": attributes.albumName
|
"album": attributes.albumName
|
||||||
}, (err: any, data: any) => {
|
}, (err: any, data: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(`[${lastfm.name}] [album.getInfo] Error: ${err}`)
|
console.error(`[${lastfm.name}] [album.getInfo] Error: ${typeof err === "string" ? err : err.message}`)
|
||||||
|
console.error(err)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -142,7 +150,7 @@ export default class lastfm {
|
||||||
} else {
|
} else {
|
||||||
return this._lfm.track.getCorrection(attributes.artistName, attributes.name, (err: any, data: any) => {
|
return this._lfm.track.getCorrection(attributes.artistName, attributes.name, (err: any, data: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(`[${lastfm.name}] [track.getCorrection] Error: ${err}`)
|
console.error(`[${lastfm.name}] [track.getCorrection] Error: ${typeof err === "string" ? err : err.message}`)
|
||||||
console.error(err)
|
console.error(err)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ const MusicKitInterop = {
|
||||||
global.ipcRenderer.send('nowPlayingItemDidChange', attributes);
|
global.ipcRenderer.send('nowPlayingItemDidChange', attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global.ipcRenderer.send('lastfm:nowPlayingChange', attributes);
|
||||||
|
|
||||||
if (MusicKit.getInstance().nowPlayingItem) {
|
if (MusicKit.getInstance().nowPlayingItem) {
|
||||||
await this.sleep(750);
|
await this.sleep(750);
|
||||||
MusicKit.getInstance().playbackRate = app.cfg.audio.playbackRate;
|
MusicKit.getInstance().playbackRate = app.cfg.audio.playbackRate;
|
||||||
|
|
|
@ -1081,7 +1081,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="md-option-line" v-show="app.cfg.lastfm.enabled">
|
<div class="md-option-line" v-show="app.cfg.lastfm.enabled">
|
||||||
<div class="md-option-segment">
|
<div class="md-option-segment">
|
||||||
{{$root.getLz('settings.option.connectivity.filterLoop')}}
|
{{$root.getLz('settings.option.connectivity.lastfmScrobble.filterLoop')}}
|
||||||
</div>
|
</div>
|
||||||
<div class="md-option-segment md-option-segment_auto">
|
<div class="md-option-segment md-option-segment_auto">
|
||||||
<label>
|
<label>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue