From 59ade61d7b269f11e9cc9bb6288387b85786f023 Mon Sep 17 00:00:00 2001 From: chme Date: Mon, 13 Mar 2017 20:03:25 +0100 Subject: [PATCH] [library] Rename constants --- src/library.c | 8 ++++---- src/library.h | 6 +++--- src/library/filescanner.c | 4 ++-- src/mpd.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/library.c b/src/library.c index 61d0d8ea..ab0cf98f 100644 --- a/src/library.c +++ b/src/library.c @@ -383,8 +383,8 @@ library_scan_media(const char *path, struct media_file_info *mfi) DPRINTF(E_DBG, L_LIB, "Scan metadata for path '%s'\n", path); - ret = METADATA_PATH_INVALID; - for (i = 0; sources[i] && ret == METADATA_PATH_INVALID; i++) + ret = LIBRARY_PATH_INVALID; + for (i = 0; sources[i] && ret == LIBRARY_PATH_INVALID; i++) { if (sources[i]->disabled || !sources[i]->scan_metadata) { @@ -394,11 +394,11 @@ library_scan_media(const char *path, struct media_file_info *mfi) ret = sources[i]->scan_metadata(path, mfi); - if (ret == METADATA_OK) + if (ret == LIBRARY_OK) DPRINTF(E_DBG, L_LIB, "Got metadata for path '%s' from library source '%s'\n", path, sources[i]->name); } - if (ret == METADATA_OK) + if (ret == LIBRARY_OK) { if (!mfi->virtual_path) mfi->virtual_path = strdup(mfi->path); diff --git a/src/library.h b/src/library.h index 16b9a852..dea7d036 100644 --- a/src/library.h +++ b/src/library.h @@ -26,9 +26,9 @@ #include "commands.h" #include "db.h" -#define METADATA_OK 0 -#define METADATA_ERROR -1 -#define METADATA_PATH_INVALID -2 +#define LIBRARY_OK 0 +#define LIBRARY_ERROR -1 +#define LIBRARY_PATH_INVALID -2 /* * Definition of a library source diff --git a/src/library/filescanner.c b/src/library/filescanner.c index f12763e1..8f0924eb 100644 --- a/src/library/filescanner.c +++ b/src/library/filescanner.c @@ -1565,10 +1565,10 @@ scan_metadata(const char *path, struct media_file_info *mfi) mfi->description = strdup("MPEG audio file"); } - return METADATA_OK; + return LIBRARY_OK; } - return METADATA_PATH_INVALID; + return LIBRARY_PATH_INVALID; } /* Thread: main */ diff --git a/src/mpd.c b/src/mpd.c index 8e339e95..fcaada98 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -1578,7 +1578,7 @@ mpd_command_add(struct evbuffer *evbuf, int argc, char **argv, char **errmsg) { // Given path is not in the library, check if it is possible to add as a non-library queue item ret = library_scan_media(argv[1], &mfi); - if (ret != METADATA_OK) + if (ret != LIBRARY_OK) { ret = asprintf(errmsg, "Failed to add song '%s' to playlist (unkown path)", argv[1]); if (ret < 0) @@ -1625,7 +1625,7 @@ mpd_command_addid(struct evbuffer *evbuf, int argc, char **argv, char **errmsg) { // Given path is not in the library, directly add it as a new queue item ret = library_scan_media(argv[1], &mfi); - if (ret != METADATA_OK) + if (ret != LIBRARY_OK) { ret = asprintf(errmsg, "Failed to add song '%s' to playlist (unkown path)", argv[1]); if (ret < 0)