[library] Rename constants

This commit is contained in:
chme 2017-03-13 20:03:25 +01:00 committed by ejurgensen
parent f4aade7f3a
commit 59ade61d7b
4 changed files with 11 additions and 11 deletions

View File

@ -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);

View File

@ -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

View File

@ -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 */

View File

@ -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)