Fix thinko breaking static playlists
This commit is contained in:
parent
55bc7986de
commit
2e00839a36
10
src/db-sql.c
10
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(pe) { free(*pe); };
|
|
||||||
} else {
|
|
||||||
if(result != DB_E_SUCCESS) {
|
if(result != DB_E_SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
} else {
|
|
||||||
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST);
|
|
||||||
return DB_E_DUPLICATE_PLAYLIST;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cnt != 0) { /* duplicate */
|
||||||
|
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST,name);
|
||||||
|
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) {
|
||||||
|
DPRINTF(E_DBG,L_SCAN,"Playlist needs updated\n");
|
||||||
|
/* welcome to texas, y'all */
|
||||||
db_delete_playlist(NULL,pm3u->id);
|
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