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": { "lastfm": {
"enabled": false, "enabled": false,
"scrobble_after": 50, "scrobble_after": 50,
"filter_loop": false,
"secrets": { "secrets": {
"username": "", "username": "",
"key": "" "key": ""

View file

@ -162,7 +162,7 @@ export default class lastfm {
* @private * @private
*/ */
private scrobbleTrack(attributes: any): void { 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) { if (this._scrobbleDelay) {
clearTimeout(this._scrobbleDelay); clearTimeout(this._scrobbleDelay);
@ -200,7 +200,7 @@ export default class lastfm {
} }
private updateNowPlayingTrack(attributes: any): void { 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 = { const nowPlaying = {
'artist': attributes.lfmTrack.artist.name, 'artist': attributes.lfmTrack.artist.name,

View file

@ -1079,6 +1079,16 @@
</label> </label>
</div> </div>
</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>
</div> </div>
</b-tab> </b-tab>