diff options
Diffstat (limited to 'src/playlist.c')
-rw-r--r-- | src/playlist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/playlist.c b/src/playlist.c index 8dd3821..47a06c3 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -97,13 +97,12 @@ fill_playlists() sqlite_int64 plID, detailID; char sql_buf[] = "SELECT ID, NAME, PATH from PLAYLISTS where ITEMS > FOUND"; + DPRINTF(E_WARN, L_SCANNER, "Parsing playlists...\n"); + if( sql_get_table(db, sql_buf, &result, &rows, NULL) != SQLITE_OK ) return -1; if( !rows ) - { - sqlite3_free_table(result); - return 0; - } + goto done; rows++; for( i=3; i<rows*3; i++ ) @@ -145,7 +144,7 @@ fill_playlists() if( last_dir ) { fname = basename(plist.path); - detailID = sql_get_int_field(db, "SELECT ID from DETAILS where PATH = '%s/%s'", last_dir, fname); + detailID = sql_get_int_field(db, "SELECT ID from DETAILS where PATH = '%q/%q'", last_dir, fname); if( detailID <= 0 ) { sqlite3_free(last_dir); @@ -219,7 +218,9 @@ found: } sql_exec(db, "UPDATE PLAYLISTS set FOUND = %d where ID = %lld", found, plID); } +done: sqlite3_free_table(result); + DPRINTF(E_WARN, L_SCANNER, "Finished parsing playlists.\n"); return 0; } |