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 "
|
result=db_sql_fetch_int(pe,&cnt,"select count(*) from playlists where "
|
||||||
"upper(title)=upper('%q')",name);
|
"upper(title)=upper('%q')",name);
|
||||||
|
|
||||||
if(result == DB_E_NOROWS) { /* good playlist name */
|
if(result != DB_E_SUCCESS) {
|
||||||
if(pe) { free(*pe); };
|
return result;
|
||||||
} else {
|
}
|
||||||
if(result != DB_E_SUCCESS) {
|
|
||||||
return result;
|
if(cnt != 0) { /* duplicate */
|
||||||
} else {
|
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST,name);
|
||||||
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST);
|
return DB_E_DUPLICATE_PLAYLIST;
|
||||||
return DB_E_DUPLICATE_PLAYLIST;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((type == PL_SMART) && (!clause)) {
|
if((type == PL_SMART) && (!clause)) {
|
||||||
|
|
|
@ -408,8 +408,11 @@ int scan_static_playlist(char *path) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pm3u)
|
if(pm3u) {
|
||||||
db_delete_playlist(NULL,pm3u->id);
|
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);
|
fd=open(path,O_RDONLY);
|
||||||
if(fd != -1) {
|
if(fd != -1) {
|
||||||
|
|
Loading…
Reference in New Issue