PDA

View Full Version : Li miting genres displayed in Live365?



totoro
2006-06-18, 17:01
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?

totoro
2006-06-18, 17:02
Probably should have posted this on the developer thread.

sorry,
Michael