inotify: fix SQL error when moving captions
Change INSERT to INSERT OR REPLACE when recording caption file moves, to avoid UNIQUE constraint failures.
This commit is contained in:
parent
910b84bcd6
commit
abc1972600
@ -350,9 +350,8 @@ inotify_insert_file(char * name, const char * path)
|
|||||||
if( !is_image(path) )
|
if( !is_image(path) )
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it's already in the database and hasn't been modified, skip it. */
|
/* If it's already in the database and hasn't been modified, skip it. */
|
||||||
|
@ -149,7 +149,7 @@ check_for_captions(const char *path, int64_t detailID)
|
|||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
sql_exec(db, "INSERT into CAPTIONS"
|
sql_exec(db, "INSERT OR REPLACE into CAPTIONS"
|
||||||
" (ID, PATH) "
|
" (ID, PATH) "
|
||||||
"VALUES"
|
"VALUES"
|
||||||
" (%lld, %Q)", detailID, file);
|
" (%lld, %Q)", detailID, file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user