Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Senior Member totoro's Avatar
    Join Date
    Jun 2006
    Location
    Boston
    Posts
    494

    Li miting genres displayed in Live365?

    I didn't see anything in the gui to do this, and not in Live365API.pm, either.

    I was thinking of doing something like putting a text file with
    genres I want (or at least strings I want genres or their parents
    to match), sticking each line of the file into an array, and doing something like this:

    sub validateGenre{
    my $test = shift;

    foreach my $genre (@acceptableGenres){
    if($test =~ /$genre/){
    return 1;
    }
    }

    return 0;
    }

    Then doing something like the following:

    # code to modify in sub genreListLoadSub

    foreach my $g ( @tmpGenres ) {
    if ( $g->{Parent_ID} != 0 ) {
    my $baseName = $parentNameCache{ $g->{Parent_ID} }
    ||= ( grep { $g->{Parent_ID} == $_->{ID} } @tmpGenres )[0]->{Display_Name};
    $g->{Display_Name} = "$baseName $g->{Display_Name}";
    }
    if(! validateGenre(genre->{Display_Name}){
    push @list, [ $g->{Display_Name}, $g->{Name} ];
    }
    }

    What do people think?

  2. #2
    Senior Member totoro's Avatar
    Join Date
    Jun 2006
    Location
    Boston
    Posts
    494

    oops

    Probably should have posted this on the developer thread.

    sorry,
    Michael

Posting Permissions

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