const char *share) {
char *owner;
- if(!playlist_parse_name(name, &owner, 0))
+ if(playlist_parse_name(name, &owner, 0))
return 0;
/* Anyone can read shared playlists */
if(!owner)
const char attribute((unused)) *share) {
char *owner;
- if(!playlist_parse_name(name, &owner, 0))
+ if(playlist_parse_name(name, &owner, 0))
return 0;
/* Anyone can modify shared playlists */
if(!owner)
char **sharep) {
int e;
- if(!playlist_parse_name(name, 0, 0)) {
+ if(playlist_parse_name(name, 0, 0)) {
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}
int e;
char *owner;
- if(!playlist_parse_name(name, &owner, 0)) {
+ if(playlist_parse_name(name, &owner, 0)) {
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}
return 0;
/* Set the new values */
if(share)
- kvp_set(&k, "share", share);
+ kvp_set(&k, "sharing", share);
if(tracks) {
char b[16];
int oldcount, n;
while(!(e = c->c_get(c, k, prepare_data(d), DB_NEXT))) {
char *name = xstrndup(k->data, k->size), *owner;
const char *share = kvp_get(kvp_urldecode(d->data, d->size),
- "share");
+ "sharing");
/* Extract owner; malformed names are skipped */
if(playlist_parse_name(name, &owner, 0)) {
error(0, "invalid playlist name '%s' found in database", name);
continue;
}
+ if(!share) {
+ error(0, "playlist '%s' has no 'sharing' key", name);
+ continue;
+ }
/* Always list public and shared playlists
* Only list private ones to their owner
* Don't list anything else
&& owner && !strcmp(owner, who)))
vector_append(v, name);
}
+ trackdb_closecursor(c);
switch(e) {
case DB_NOTFOUND:
break;
int e;
char *owner;
- if(!playlist_parse_name(name, &owner, 0)) {
+ if(playlist_parse_name(name, &owner, 0)) {
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}