Fix thinko breaking static playlists
This commit is contained in:
parent
55bc7986de
commit
2e00839a36
16
src/db-sql.c
16
src/db-sql.c
|
@ -480,15 +480,13 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
|
|||
result=db_sql_fetch_int(pe,&cnt,"select count(*) from playlists where "
|
||||
"upper(title)=upper('%q')",name);
|
||||
|
||||
if(result == DB_E_NOROWS) { /* good playlist name */
|
||||
if(pe) { free(*pe); };
|
||||
} else {
|
||||
if(result != DB_E_SUCCESS) {
|
||||
return result;
|
||||
} else {
|
||||
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST);
|
||||
return DB_E_DUPLICATE_PLAYLIST;
|
||||
}
|
||||
if(result != DB_E_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if(cnt != 0) { /* duplicate */
|
||||
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST,name);
|
||||
return DB_E_DUPLICATE_PLAYLIST;
|
||||
}
|
||||
|
||||
if((type == PL_SMART) && (!clause)) {
|
||||
|
|
|
@ -408,8 +408,11 @@ int scan_static_playlist(char *path) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if(pm3u)
|
||||
db_delete_playlist(NULL,pm3u->id);
|
||||
if(pm3u) {
|
||||
DPRINTF(E_DBG,L_SCAN,"Playlist needs updated\n");
|
||||
/* welcome to texas, y'all */
|
||||
db_delete_playlist(NULL,pm3u->id);
|
||||
}
|
||||
|
||||
fd=open(path,O_RDONLY);
|
||||
if(fd != -1) {
|
||||
|
|
Loading…
Reference in New Issue