From e20b851f2d9f2a69a9daaa8c3bb7ee62d9904325 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 20 Jun 2006 03:12:45 +0000 Subject: [PATCH] Fix erroneous messages on bad playlists --- src/db-generic.c | 3 ++- src/db-generic.h | 1 + src/db-sql.c | 2 +- src/mp3-scanner.c | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/db-generic.c b/src/db-generic.c index 33f81e1c..5be6fb38 100644 --- a/src/db-generic.c +++ b/src/db-generic.c @@ -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 */ diff --git a/src/db-generic.h b/src/db-generic.h index 2b96773a..d3cf133e 100644 --- a/src/db-generic.h +++ b/src/db-generic.h @@ -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 { diff --git a/src/db-sql.c b/src/db-sql.c index 89c3b266..8f0b66c0 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -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; diff --git a/src/mp3-scanner.c b/src/mp3-scanner.c index 9d51b179..2439a5e4 100644 --- a/src/mp3-scanner.c +++ b/src/mp3-scanner.c @@ -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); } }