Filter loop added

This commit is contained in:
Core 2022-06-16 14:47:52 +01:00
parent 23ad2640dc
commit 7850493c9e
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
3 changed files with 13 additions and 2 deletions

View file

@ -222,6 +222,7 @@ export class Store {
"lastfm": {
"enabled": false,
"scrobble_after": 50,
"filter_loop": false,
"secrets": {
"username": "",
"key": ""

View file

@ -162,7 +162,7 @@ export default class lastfm {
* @private
*/
private scrobbleTrack(attributes: any): void {
if (!this._authenticated || !attributes || (this._scrobbleCache.track === attributes.lfmTrack.name)) return;
if (!this._authenticated || !attributes || (this._utils.getStoreValue("lastfm.filter_loop") && this._scrobbleCache.track === attributes.lfmTrack.name)) return;
if (this._scrobbleDelay) {
clearTimeout(this._scrobbleDelay);
@ -200,7 +200,7 @@ export default class lastfm {
}
private updateNowPlayingTrack(attributes: any): void {
if (!this._authenticated || !attributes || (this._nowPlayingCache.track === attributes.lfmTrack.name)) return;
if (!this._authenticated || !attributes || (this._utils.getStoreValue("lastfm.filter_loop") && this._nowPlayingCache.track === attributes.lfmTrack.name)) return;
const nowPlaying = {
'artist': attributes.lfmTrack.artist.name,

View file

@ -1079,6 +1079,16 @@
</label>
</div>
</div>
<div class="md-option-line" v-show="app.cfg.lastfm.enabled">
<div class="md-option-segment">
{{$root.getLz('settings.option.connectivity.filterLoop')}}
</div>
<div class="md-option-segment md-option-segment_auto">
<label>
<input type="checkbox" v-model="app.cfg.lastfm.filter_loop" switch/>
</label>
</div>
</div>
</div>
</div>
</b-tab>