Mercurial > audlegacy-plugins
diff src/scrobbler/plugin.c @ 719:be03e09c7c20 trunk
[svn] - always bail on http streams
| author | nenolod |
|---|---|
| date | Sat, 24 Feb 2007 10:57:24 -0800 |
| parents | 45c9130027d9 |
| children | c380f078aa26 |
line wrap: on
line diff
--- a/src/scrobbler/plugin.c Sat Feb 24 10:53:12 2007 -0800 +++ b/src/scrobbler/plugin.c Sat Feb 24 10:57:24 2007 -0800 @@ -12,6 +12,7 @@ #include <audacious/playlist.h> #include <audacious/configdb.h> #include <audacious/beepctrl.h> +#include <audacious/strings.h> #include <unistd.h> #include <stdio.h> @@ -205,19 +206,7 @@ static char ishttp(const char *a) { - char *tmp, *bp; - int status = 0; - - if (!a || !*a) - return 0; - - tmp = strdup(a); - for (bp = tmp; *bp; bp++) - *bp = toupper((int) *bp); - if (strstr(tmp, "HTTP://")) - status = -1; - free(tmp); - return status; + return str_has_prefix_nocase(a, "http://"); } /* Following code thanks to nosuke @@ -254,6 +243,10 @@ pos_c = xmms_remote_get_playlist_pos(XS_CS); /* current file name */ file_c = xmms_remote_get_playlist_file(XS_CS, pos_c); + + if (ishttp(file_c)) + return dosubmit; + /* total number */ playlistlen_c = xmms_remote_get_playlist_length(XS_CS); /* current playtime */
