Avoid duplicate rows in the admin table

This commit is contained in:
ejurgensen 2014-08-27 22:12:42 +02:00
parent ae3b5077ec
commit 2545aedc2a

View File

@ -3303,7 +3303,7 @@ db_spotify_pl_delete(int id)
int
db_admin_add(const char *key, const char *value)
{
#define Q_TMPL "INSERT INTO admin (key, value) VALUES ('%q', '%q');"
#define Q_TMPL "INSERT OR REPLACE INTO admin (key, value) VALUES ('%q', '%q');"
char *query;
query = sqlite3_mprintf(Q_TMPL, key, value);