Fix erroneous messages on bad playlists

This commit is contained in:
Ron Pedde 2006-06-20 03:12:45 +00:00
parent 5859bca5ac
commit e20b851f2d
4 changed files with 7 additions and 3 deletions

View File

@ -358,7 +358,8 @@ char *db_error_list[] = {
"Passed buffer too small for result",
"Wrong db schema. Use mtd-update to upgrade the db.",
"Database error: %s",
"Malloc error"
"Malloc error",
"Path not found"
};
/* Globals */

View File

@ -220,6 +220,7 @@ extern int db_force_rescan(char **pe);
#define DB_E_WRONGVERSION 0x0C /**< must upgrade db */
#define DB_E_DB_ERROR 0x0D /**< gdbm error */
#define DB_E_MALLOC 0x0E /**< malloc error */
#define DB_E_NOTFOUND 0x0F /**< path not found */
/* describes the individual database handlers */
typedef struct tag_dbinfo {

View File

@ -1804,7 +1804,7 @@ MP3FILE *db_sql_fetch_path(char **pe, char *path, int index) {
if(err != DB_E_SUCCESS) {
if(err == DB_E_NOROWS) { /* Override generic error */
if(pe) { free(*pe); };
db_get_error(pe,DB_E_INVALID_SONGID);
db_get_error(pe,DB_E_NOTFOUND);
return NULL;
}
return NULL;

View File

@ -490,11 +490,13 @@ int scan_static_playlist(char *path) {
// might be valid, might not...
if((pmp3=db_fetch_path(&perr,real_path,0))) {
/* 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_dispose_item(pmp3);
} else {
DPRINTF(E_WARN,L_SCAN|L_PL,"Playlist entry %s bad: %s\n",
path,perr);
linebuffer,perr);
free(perr);
}
}