PDA

View Full Version : ShoutcastBrowser request



Eric Gauthier
2004-04-24, 07:25
I have started using the ShoutcastBrowser plugin, and it is great!

I have a request for added functionality. Is it possible to add a list of
"don't care" genres? The plugin could then ignore or discard streams in
those genres after munging.

There are many genres that I never listen to, and would love to just
"remove" them.

I saw the "legit_genres" list in the code, but that appears to list genres
that should always be listed.

Thanks.

-Eric

Daniel Cohen
2004-04-24, 07:56
On 24/4/04 at 10:25 am -0400, Eric Gauthier wrote
>I have a request for added functionality. Is it possible to add a
>list of "don't care" genres? The plugin could then ignore or
>discard streams in those genres after munging.

Seconded.

By the way, on the version I have been using (I haven't yet used the
latest version), the information about the plugin refers to a
"Recently played" selection. But the display lists as "Favorites".
"Favorites" and "recently played" aren't the same thing at all, and
there is a case for having both. "Recently played" would be adjusted
by the plugin without user action (other than saying how many streams
it should list), whereas "favorites" would have to be selected by the
user in some way.
--
Daniel Cohen

Peter Heslin
2004-04-24, 15:52
On Sat, Apr 24, 2004 at 10:25:27AM -0400, Eric Gauthier wrote:
> I have started using the ShoutcastBrowser plugin, and it is great!
>
> I have a request for added functionality. Is it possible to add a list of
> "don't care" genres? The plugin could then ignore or discard streams in
> those genres after munging.
>
> There are many genres that I never listen to, and would love to just
> "remove" them.

The genres are even more multitudinous and chaotic before a lot of
processing is done to them. The default behavior is very inclusive
because I didn't want to be the Genre Nazi, and I think that is the
correct way for the default to be. But you are right that there
should be a way to customize this.

I don't think you really want a "don't care" list, because you would
have to keep it constantly up-to-date. If some Bozo started a stream
with a genre he called "Mr Bozo's wicked tunez", then you'd have to
turn that one off explicitly, ad infinitum.

So I have added an option to allow you complete freedom to define your
own genres, instead of using my definitions. You make a file like
this:

Hip_Hop hip_hop hiphop rap
Reggae reggae dancehall ragga

Each line in this file defines one genre per line, and each line
consists of a series of terms separated by whitespace. The first term
is the name of the genre, and each subsequent term is a pattern
associated with that genre. If any of these patterns matches the
advertised genre of a stream, that stream is considered to belong to
that genre. You may use an underscore to represent a space within any
of these terms.

You then enter the location of this file in the web interface.

All streams with a genre definition that fails to match any of your
patterns are put in a "Miscellaneous" category.

The "Order of Definition" sorting order means that the genres will
appear in the order of their definition in this file, rather than
alphabetically, etc.

You can get it at:
http://www.dur.ac.uk/p.j.heslin/amusements/shoutcast/ShoutcastBrowser.pm

If anyone comes up with a particularly thorough genre definition
file, he/she should share it with the list, so that others can
use/adapt it.

Peter

Peter Heslin
2004-04-24, 15:53
On Sat, Apr 24, 2004 at 03:56:21PM +0100, Daniel Cohen wrote:
> By the way, on the version I have been using (I haven't yet used the
> latest version), the information about the plugin refers to a
> "Recently played" selection. But the display lists as "Favorites".
> "Favorites" and "recently played" aren't the same thing at all, and
> there is a case for having both. "Recently played" would be adjusted
> by the plugin without user action (other than saying how many streams
> it should list), whereas "favorites" would have to be selected by the
> user in some way.

Fair enough -- I've changed the text to "Recently played"

Peter

Daniel Cohen
2004-04-25, 00:44
On 24/4/04 at 11:52 pm +0100, Peter Heslin wrote
>All streams with a genre definition that fails to match any of your
>patterns are put in a "Miscellaneous" category.

Would submenus be easily doable? I think most people would not want
the streams to just be put in a "Miscellaneous" category, as that
would make them difficult to find on rare occasions when one wanted
them (for instance, if I had a house-guest who wanted some music I
never listen to). That way, one could still have the genres separated
out as subitems of "Miscellaneous".
--
Daniel Cohen

Peter Heslin
2004-04-25, 09:58
On Sun, Apr 25, 2004 at 08:44:56AM +0100, Daniel Cohen wrote:
> On 24/4/04 at 11:52 pm +0100, Peter Heslin wrote
> >All streams with a genre definition that fails to match any of your
> >patterns are put in a "Miscellaneous" category.
>
> Would submenus be easily doable?

Not particularly easy, if done with proper generality.

> I think most people would not want
> the streams to just be put in a "Miscellaneous" category, as that
> would make them difficult to find on rare occasions when one wanted
> them (for instance, if I had a house-guest who wanted some music I
> never listen to). That way, one could still have the genres separated
> out as subitems of "Miscellaneous".

So just make a more lengthy genre definition file, and put your
favorite genres at the top, and select the "order of definition"
sorting method. Then your favorite genres will come first, and you
can put those genres that you listen to seldom further down on the
list.

Peter

Peter Heslin
2004-04-25, 10:03
On Sun, Apr 25, 2004 at 10:16:54AM -0400, Eric Gauthier wrote:
> Peter,
>
> First, thank you for an unbelievable quick response to the request. I have
> started playing with this feature, and it is great. I'll need to take a
> look at the Shoutcast site, or the XML feed to try and come up with a decent
> definition file.

You can look at the raw genre data reported by each stream by
examining the "Genre" field in the rightmost menu for each stream. So
if your genre definition file fails to catch a stream you expected to
catch, you can examine it to see what you need to add.

> One more request (isn't there always), it may be useful to have the keywords
> also have a negation feature. I haven't looked at your matching code yet,
> is it just using a regexp? For example, a keyword of "!deutsch" could cause
> all streams that contain "deutsch" to not be matched (tut mir leid fuer alle
> die Deutschen, nuer ein Beispiel!).

The patterns are just regexps, joined by alternation or |, and
matched against the genre reported by each stream. Perhaps some Perl
trickery in your patterns could do what you need.

Peter

Daniel Cohen
2004-04-25, 22:28
On 24/4/04 at 11:52 pm +0100, Peter Heslin wrote
>So I have added an option to allow you complete freedom to define your
>own genres, instead of using my definitions. You make a file like
>this:
>
>Hip_Hop hip_hop hiphop rap
>Reggae reggae dancehall ragga
>
>Each line in this file defines one genre per line, and each line
>consists of a series of terms separated by whitespace. The first term
>is the name of the genre, and each subsequent term is a pattern
>associated with that genre. If any of these patterns matches the
>advertised genre of a stream, that stream is considered to belong to
>that genre. You may use an underscore to represent a space within any
>of these terms.
>
>You then enter the location of this file in the web interface.

I had troubles as a Mac user. First, there's a little trick needed.

One might think that the path to the file is (depending on where the
file is, what your drive is called, etc.) something like

HardDrive/Users/Me/...

But that gets rejected, the correct syntax being

/Volumes/HardDrive/Users/Me/...


There's another issue. I created a genre file, beginning with

bluegrass bluegrass
blues blues
celtic celtic

But the only genre that came up was bluegrass, with blues and celtic
stations showing among the available streams in this genre.

This seems to be a matter of how the lines end. Mac endings are
carriage returns, but the file needs line endings to be line feeds
(or, for better readability on the Mac, CR+LF). There are plenty of
programs on the Mac that will add line feeds.

There's an oddity in that all my custom genres except the first,
which is bluegrass, now appear in the list. Would that happen if no
bluegrass stations happened to be playing at the time? Though it
would surprise me if there were no active stations.

Finally, I note that my suggestion of subgenres is not practical.
What should work, and would be useful for the reasons I gave when
suggesting subgenres, is a check button for switching the custom
genre file on and off, so it reverted to default behaviour when
unchecked.
--
Daniel Cohen

Peter Heslin
2004-04-26, 16:48
On Mon, Apr 26, 2004 at 06:28:15AM +0100, Daniel Cohen wrote:
> There's another issue. I created a genre file, beginning with
>
> bluegrass bluegrass
> blues blues
> celtic celtic
>
> But the only genre that came up was bluegrass, with blues and celtic
> stations showing among the available streams in this genre.
>
> This seems to be a matter of how the lines end. Mac endings are
> carriage returns, but the file needs line endings to be line feeds
> (or, for better readability on the Mac, CR+LF). There are plenty of
> programs on the Mac that will add line feeds.

This is odd. I'm just using the standard Perl idiom for reading a
line of a file <FILE>. I've put a version with one changed line
(added chomp) up on the web site -- it's the only thing I can think
of offhand that might fix this.

>
> There's an oddity in that all my custom genres except the first,
> which is bluegrass, now appear in the list. Would that happen if no
> bluegrass stations happened to be playing at the time? Though it
> would surprise me if there were no active stations.

It's quite likely that there just happened to be no bluegrass streams
-- the content of the feed from SHOUTcast varies considerably over
time. Did you try it with 2000 streams? If there is a station you
think should have registered in a particular genre, look at its genre
info -- it may not advertise itself in the way you expect.

>
> Finally, I note that my suggestion of subgenres is not practical.
> What should work, and would be useful for the reasons I gave when
> suggesting subgenres, is a check button for switching the custom
> genre file on and off, so it reverted to default behaviour when
> unchecked.

Maybe a choice of many, medium, few, or custom genres. This would be
easy to add if others would come up with the "medium" and "few" genre
definition files, and agreed for them to be added to the server.


Peter

Daniel Cohen
2004-04-28, 13:40
On 27/4/04 at 12:48 am +0100, Peter Heslin wrote
>On Mon, Apr 26, 2004 at 06:28:15AM +0100, Daniel Cohen wrote:
>> There's another issue. I created a genre file, beginning with
>>
>> bluegrass bluegrass
>> blues blues
>> celtic celtic
>>
>> But the only genre that came up was bluegrass, with blues and celtic
>> stations showing among the available streams in this genre.
>>
>> This seems to be a matter of how the lines end. Mac endings are
>> carriage returns, but the file needs line endings to be line feeds
>> (or, for better readability on the Mac, CR+LF). There are plenty of
>> programs on the Mac that will add line feeds.
>
>This is odd. I'm just using the standard Perl idiom for reading a
>line of a file <FILE>. I've put a version with one changed line
>(added chomp) up on the web site -- it's the only thing I can think
>of offhand that might fix this.


Well, I haven't been able to reproduce the problem, and the one or
two other oddities that have come up I can't understand either. So we
can only leave it for the present.

There is another issue, where the plugin is working as it should, but
users could easily get caught out. I put my custom genres in a text
file called Custom, set the web browser to read a file called Custon
in the right path, and did not get the genres showing. I'm pretty
sure what the issue is here. My text editor (and the Finder - I am
using Mac OS X, I believe the same issue can come up in Windows) is
set not to show extensions. So the file was showing to me, both in
the Save dialog and when viewed in its folder's window, with the name
Custom but its true name was Custom.txt. So of course, SlimServer
couldn't find it.

Certainly the plugin should not be changed, but you might want to
point this out in the documentation.

>
>>
>> There's an oddity in that all my custom genres except the first,
>> which is bluegrass, now appear in the list. Would that happen if no
>> bluegrass stations happened to be playing at the time? Though it
>> would surprise me if there were no active stations.
>
>It's quite likely that there just happened to be no bluegrass streams
>-- the content of the feed from SHOUTcast varies considerably over
>time. Did you try it with 2000 streams? If there is a station you
>think should have registered in a particular genre, look at its genre
>info -- it may not advertise itself in the way you expect.

Yes, bluegrass does appear when I increase the number of streams to
2000. In what kind of order do the streams chosen get downloaded from
Shoutcast? That is, if the limit is 300, *which* 300 streams get
selected, is it most popular, alphabetical, or what?

By the way, what happens if one sets "Most Popular" to 0? I ask
because in other places 0 acts as "no restriction". For myself, Most
Popular is an irrelevant option, which I would just as soon omit.
--
Daniel Cohen