Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    906

    Ignore Artist/Title/Album/Genre when scrobbling

    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.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,987

    Ignore Artist/Title/Album/Genrewhen scrobbling

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


    The \Q indeed makes sure the strings are not interpreted as regexes, as
    brackets etc. might break things.

    > John Smith 2018/02/12 - 1
    > John Smith 2018/02/12 - 2
    > Fred 2018/02/12 - 1
    > Fred 2018/02/12 - 2

    Would you have any other track title with "John Smith" in it? Ok, "Fred"
    probably is a bit generic... If you create the cue sheet yourself,
    couldn't you tag those tracks with a genre or keyword in the title which
    would make the black-listing easier?

    --
    --

    Michael

  3. #3
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    906
    I do generate the .cue files so can do it differently.
    I want each spoken link to have a unique title so that I can play them individually (and would not want LMS to have hundreds of tracks with the same name).
    "Genre" is, unfortunately, a REM header field - i.e. it applies to the whole file - so I can't change that per track (of course, LMS could be changed to allow it to be specified per track).

    I could easily put in a likely to be unique string as part of the title - like "SpokenLink" but it was not clear to me how substrings would match ... so I abstracted the code:

    Code:
    @ignoreTitles  = split(/\s*,\s*/, "aaa,bbbb,ccccc,Some text in here");
    
    print @ignoreTitles[1]."\n";
    
    if (grep { "some text in here" =~ /\Q$_\E/i } @ignoreTitles){
        print("matched");
    } else {
        print("not matched");
    }
    As expected ... this one says that it matched.
    However, if I change the searched for string on line 5 to "Some text in here but longer" then it also matches ... which is good for me but is that what LMS really wants to do?

    e.g. if someone configures LMS to ignore
    Buffalo Gals
    then I think it would also ignore
    Buffalo Gals Go Round and Round

    Also - with my contrived data ... a track called "hello world aaa how are you?" would result in a match with "aaa".

    Anyway - with LMS like it is now I can make it work for me by simply inserting text string into each spoken link track title.


    Perhaps to have a full regex capability in the specifier could be done by having a prefix - then I could have something like
    regex:.* - [12][0-9][0-9][0-9]\/[01][0-9] - [0-9]*$

    Hmmm - ok - not very nice - I'll go with LMS like it is now and add a unique substring to the title.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  4. #4
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    906
    It worked (I used "Link: " without the quotes).
    Now off to regenerate loads of .cue files.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •