Commit 442dadd6 authored by Max Kellermann's avatar Max Kellermann

playlist/soundcloud: change scheme check to assertion

The MPD core takes care for checking the scheme.
parent da9dd58f
......@@ -322,18 +322,10 @@ soundcloud_parse_json(const char *url, yajl_handle hand,
static SongEnumerator *
soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
{
char *s = g_strdup(uri);
char *scheme = s;
assert(memcmp(uri, "soundcloud://", 13) == 0);
char *const s = g_strdup(uri + 13);
char *p = s;
for (; *p; p++) {
if (*p == ':' && *(p+1) == '/' && *(p+2) == '/') {
*p = 0;
p += 3;
break;
}
}
char *arg = p;
for (; *p; p++) {
if (*p == '/') {
......@@ -345,14 +337,6 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
char *rest = p;
if (strcmp(scheme, "soundcloud") != 0) {
FormatWarning(soundcloud_domain,
"incompatible scheme for soundcloud plugin: %s",
scheme);
g_free(s);
return nullptr;
}
char *u = nullptr;
if (strcmp(arg, "track") == 0) {
u = g_strconcat("https://api.soundcloud.com/tracks/",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment