mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 14:43:21 -05:00
Fix erroneous messages on bad playlists
This commit is contained in:
parent
5859bca5ac
commit
e20b851f2d
@ -358,7 +358,8 @@ char *db_error_list[] = {
|
|||||||
"Passed buffer too small for result",
|
"Passed buffer too small for result",
|
||||||
"Wrong db schema. Use mtd-update to upgrade the db.",
|
"Wrong db schema. Use mtd-update to upgrade the db.",
|
||||||
"Database error: %s",
|
"Database error: %s",
|
||||||
"Malloc error"
|
"Malloc error",
|
||||||
|
"Path not found"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Globals */
|
/* Globals */
|
||||||
|
@ -220,6 +220,7 @@ extern int db_force_rescan(char **pe);
|
|||||||
#define DB_E_WRONGVERSION 0x0C /**< must upgrade db */
|
#define DB_E_WRONGVERSION 0x0C /**< must upgrade db */
|
||||||
#define DB_E_DB_ERROR 0x0D /**< gdbm error */
|
#define DB_E_DB_ERROR 0x0D /**< gdbm error */
|
||||||
#define DB_E_MALLOC 0x0E /**< malloc error */
|
#define DB_E_MALLOC 0x0E /**< malloc error */
|
||||||
|
#define DB_E_NOTFOUND 0x0F /**< path not found */
|
||||||
|
|
||||||
/* describes the individual database handlers */
|
/* describes the individual database handlers */
|
||||||
typedef struct tag_dbinfo {
|
typedef struct tag_dbinfo {
|
||||||
|
@ -1804,7 +1804,7 @@ MP3FILE *db_sql_fetch_path(char **pe, char *path, int index) {
|
|||||||
if(err != DB_E_SUCCESS) {
|
if(err != DB_E_SUCCESS) {
|
||||||
if(err == DB_E_NOROWS) { /* Override generic error */
|
if(err == DB_E_NOROWS) { /* Override generic error */
|
||||||
if(pe) { free(*pe); };
|
if(pe) { free(*pe); };
|
||||||
db_get_error(pe,DB_E_INVALID_SONGID);
|
db_get_error(pe,DB_E_NOTFOUND);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -490,11 +490,13 @@ int scan_static_playlist(char *path) {
|
|||||||
// might be valid, might not...
|
// might be valid, might not...
|
||||||
if((pmp3=db_fetch_path(&perr,real_path,0))) {
|
if((pmp3=db_fetch_path(&perr,real_path,0))) {
|
||||||
/* FIXME: better error handling */
|
/* FIXME: better error handling */
|
||||||
|
DPRINTF(E_DBG,L_SCAN|L_PL,"Resolved %s to %d\n",real_path,
|
||||||
|
pmp3->id);
|
||||||
db_add_playlist_item(NULL,playlistid,pmp3->id);
|
db_add_playlist_item(NULL,playlistid,pmp3->id);
|
||||||
db_dispose_item(pmp3);
|
db_dispose_item(pmp3);
|
||||||
} else {
|
} else {
|
||||||
DPRINTF(E_WARN,L_SCAN|L_PL,"Playlist entry %s bad: %s\n",
|
DPRINTF(E_WARN,L_SCAN|L_PL,"Playlist entry %s bad: %s\n",
|
||||||
path,perr);
|
linebuffer,perr);
|
||||||
free(perr);
|
free(perr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user