mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 16:03:23 -05:00
Add more logging for duplicate playlist
This commit is contained in:
parent
9239e0ad36
commit
23e567a94b
@ -657,6 +657,7 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
|
|||||||
char *criteria;
|
char *criteria;
|
||||||
char *estring;
|
char *estring;
|
||||||
char *correct_path;
|
char *correct_path;
|
||||||
|
SQL_ROW row;
|
||||||
|
|
||||||
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);
|
||||||
@ -666,6 +667,12 @@ int db_sql_add_playlist(char **pe, char *name, int type, char *clause, char *pat
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(cnt != 0) { /* duplicate */
|
if(cnt != 0) { /* duplicate */
|
||||||
|
db_sql_fetch_row(NULL,&row, "select * from playlists where "
|
||||||
|
"upper(title)=upper('%q')",name);
|
||||||
|
DPRINTF(E_LOG,L_MISC,"Attempt to add duplicate playlist: '%s' "
|
||||||
|
"type: %d, path: %s, idx: %d\n",name,atoi(row[PL_TYPE]),
|
||||||
|
row[PL_PATH],atoi(row[PL_IDX]));
|
||||||
|
db_sql_dispose_row();
|
||||||
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST,name);
|
db_get_error(pe,DB_E_DUPLICATE_PLAYLIST,name);
|
||||||
return DB_E_DUPLICATE_PLAYLIST;
|
return DB_E_DUPLICATE_PLAYLIST;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user