chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
error/fatal/info -> disorder_error/fatal/info
[disorder]
/
lib
/
trackdb-playlists.c
diff --git
a/lib/trackdb-playlists.c
b/lib/trackdb-playlists.c
index f9f8252068e099ae601447739b29f72ef7cad24e..fd333938968eff847f2d9e7f9a45d06fc0b27897 100644
(file)
--- a/
lib/trackdb-playlists.c
+++ b/
lib/trackdb-playlists.c
@@
-160,7
+160,7
@@
int trackdb_playlist_get(const char *name,
int e;
if(playlist_parse_name(name, 0, 0)) {
int e;
if(playlist_parse_name(name, 0, 0)) {
- error(0, "invalid playlist name '%s'", name);
+
disorder_
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}
WITH_TRANSACTION(trackdb_playlist_get_tid(name, who,
return EINVAL;
}
WITH_TRANSACTION(trackdb_playlist_get_tid(name, who,
@@
-186,7
+186,7
@@
static int trackdb_playlist_get_tid(const char *name,
return e;
/* Get sharability */
if(!(s = kvp_get(k, "sharing"))) {
return e;
/* Get sharability */
if(!(s = kvp_get(k, "sharing"))) {
- error(0, "playlist '%s' has no 'sharing' key", name);
+
disorder_
error(0, "playlist '%s' has no 'sharing' key", name);
s = "private";
}
/* Check the read is allowed */
s = "private";
}
/* Check the read is allowed */
@@
-197,12
+197,12
@@
static int trackdb_playlist_get_tid(const char *name,
*sharep = xstrdup(s);
/* Get track count */
if(!(s = kvp_get(k, "count"))) {
*sharep = xstrdup(s);
/* Get track count */
if(!(s = kvp_get(k, "count"))) {
- error(0, "playlist '%s' has no 'count' key", name);
+
disorder_
error(0, "playlist '%s' has no 'count' key", name);
s = "0";
}
ntracks = atoi(s);
if(ntracks < 0) {
s = "0";
}
ntracks = atoi(s);
if(ntracks < 0) {
- error(0, "playlist '%s' has negative count", name);
+
disorder_
error(0, "playlist '%s' has negative count", name);
ntracks = 0;
}
/* Return track count */
ntracks = 0;
}
/* Return track count */
@@
-216,7
+216,7
@@
static int trackdb_playlist_get_tid(const char *name,
for(int n = 0; n < ntracks; ++n) {
snprintf(b, sizeof b, "%d", n);
if(!(s = kvp_get(k, b))) {
for(int n = 0; n < ntracks; ++n) {
snprintf(b, sizeof b, "%d", n);
if(!(s = kvp_get(k, b))) {
- error(0, "playlist '%s' lacks track %d", name, n);
+
disorder_
error(0, "playlist '%s' lacks track %d", name, n);
s = "unknown";
}
tracks[n] = xstrdup(s);
s = "unknown";
}
tracks[n] = xstrdup(s);
@@
-260,7
+260,7
@@
int trackdb_playlist_set(const char *name,
char *owner;
if(playlist_parse_name(name, &owner, 0)) {
char *owner;
if(playlist_parse_name(name, &owner, 0)) {
- error(0, "invalid playlist name '%s'", name);
+
disorder_
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}
/* Check valid share types */
return EINVAL;
}
/* Check valid share types */
@@
-269,13
+269,13
@@
int trackdb_playlist_set(const char *name,
/* Playlists with an owner must be public or private */
if(strcmp(share, "public")
&& strcmp(share, "private")) {
/* Playlists with an owner must be public or private */
if(strcmp(share, "public")
&& strcmp(share, "private")) {
- error(0, "playlist '%s' must be public or private", name);
+
disorder_
error(0, "playlist '%s' must be public or private", name);
return EINVAL;
}
} else {
/* Playlists with no owner must be shared */
if(strcmp(share, "shared")) {
return EINVAL;
}
} else {
/* Playlists with no owner must be shared */
if(strcmp(share, "shared")) {
- error(0, "playlist '%s' must be shared", name);
+
disorder_
error(0, "playlist '%s' must be shared", name);
return EINVAL;
}
}
return EINVAL;
}
}
@@
-318,7
+318,7
@@
static int trackdb_playlist_set_tid(const char *name,
}
/* Check that the modification is allowed */
if(!(s = kvp_get(k, "sharing"))) {
}
/* Check that the modification is allowed */
if(!(s = kvp_get(k, "sharing"))) {
- error(0, "playlist '%s' has no 'sharing' key", name);
+
disorder_
error(0, "playlist '%s' has no 'sharing' key", name);
s = "private";
}
if(!playlist_may_write(name, who, s))
s = "private";
}
if(!playlist_may_write(name, who, s))
@@
-335,7
+335,7
@@
static int trackdb_playlist_set_tid(const char *name,
/* Sanity check track count */
if(ntracks < 0 || ntracks > config->playlist_max) {
/* Sanity check track count */
if(ntracks < 0 || ntracks > config->playlist_max) {
- error(0, "invalid track count %d", ntracks);
+
disorder_
error(0, "invalid track count %d", ntracks);
return EINVAL;
}
/* Set the tracks */
return EINVAL;
}
/* Set the tracks */
@@
-398,11
+398,11
@@
static int trackdb_playlist_list_tid(const char *who,
/* Extract owner; malformed names are skipped */
if(playlist_parse_name(name, &owner, 0)) {
/* Extract owner; malformed names are skipped */
if(playlist_parse_name(name, &owner, 0)) {
- error(0, "invalid playlist name '%s' found in database", name);
+
disorder_
error(0, "invalid playlist name '%s' found in database", name);
continue;
}
if(!share) {
continue;
}
if(!share) {
- error(0, "playlist '%s' has no 'sharing' key", name);
+
disorder_
error(0, "playlist '%s' has no 'sharing' key", name);
continue;
}
/* Always list public and shared playlists
continue;
}
/* Always list public and shared playlists
@@
-422,7
+422,7
@@
static int trackdb_playlist_list_tid(const char *who,
case DB_LOCK_DEADLOCK:
return e;
default:
case DB_LOCK_DEADLOCK:
return e;
default:
- fatal(0, "c->c_get: %s", db_strerror(e));
+
disorder_
fatal(0, "c->c_get: %s", db_strerror(e));
}
vector_terminate(v);
if(playlistsp)
}
vector_terminate(v);
if(playlistsp)
@@
-449,7
+449,7
@@
int trackdb_playlist_delete(const char *name,
char *owner;
if(playlist_parse_name(name, &owner, 0)) {
char *owner;
if(playlist_parse_name(name, &owner, 0)) {
- error(0, "invalid playlist name '%s'", name);
+
disorder_
error(0, "invalid playlist name '%s'", name);
return EINVAL;
}
/* We've checked as much as we can for now, now go and attempt the change */
return EINVAL;
}
/* We've checked as much as we can for now, now go and attempt the change */
@@
-470,7
+470,7
@@
static int trackdb_playlist_delete_tid(const char *name,
return e;
/* Check that modification is allowed */
if(!(s = kvp_get(k, "sharing"))) {
return e;
/* Check that modification is allowed */
if(!(s = kvp_get(k, "sharing"))) {
- error(0, "playlist '%s' has no 'sharing' key", name);
+
disorder_
error(0, "playlist '%s' has no 'sharing' key", name);
s = "private";
}
if(!playlist_may_write(name, who, s))
s = "private";
}
if(!playlist_may_write(name, who, s))