mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
[library] Rename constants
This commit is contained in:
parent
f4aade7f3a
commit
59ade61d7b
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user