Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5306

Ignore Artist/Title/Album/Genre when scrobbling

$
0
0
I know that recent LMS can be configured to ignore certain tracks for scrobbling purposes - and that the definitions are comma separated lists but can they be regex?


I found the code in Slim/Plugin/AudioScrobbler/Plugin.pm - and I think it does not allow it

Code:

        my @ignoreTitles  = split(/\s*,\s*/, $prefs->get('ignoreTitles'));
        my @ignoreAlbums  = split(/\s*,\s*/, $prefs->get('ignoreAlbums'));
        my @ignoreArtists = split(/\s*,\s*/, $prefs->get('ignoreArtists'));
        my @ignoreGenres  = split(/\s*,\s*/, $prefs->get('ignoreGenres'));

        if ( (scalar @ignoreGenres && $track->genre && grep { $track->genre->name =~ /\Q$_\E/i } @ignoreGenres )
                || (scalar @ignoreTitles && grep { $title =~ /\Q$_\E/i } @ignoreTitles)
                || (scalar @ignoreArtists && grep { ($track->artistName || $meta->{artist} || '') =~ /\Q$_\E/i } @ignoreArtists)
                || (scalar @ignoreAlbums && grep { ($track->albumname || $meta->{album} || '') =~ /\Q$_\E/i } @ignoreAlbums)
        ) {
                main::DEBUGLOG && $log->debug( sprintf("Ignoring %s, it's failing one of the ignored items tests: %s, %s, %s", $title, $track->artistName || $meta->{artist}, $track->albumname || $meta->{album}, ($track->genre ? $track->genre->name : '')) );
                return;
        }

However, I am not an expert on use of \Q and \E and what the contents of $_ is at that point.

Reason:
I have some generated titles that are created by a .cue file that splits up a radio show ... the spoken links have titles in general form of
show name - link number
e.g.
John Smith 2018/02/12 - 1
John Smith 2018/02/12 - 2
Fred 2018/02/12 - 1
Fred 2018/02/12 - 2
etc

and I would love to avoid scrobbling them.

Viewing all articles
Browse latest Browse all 5306

Trending Articles