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:
Justin Maggard 2016-03-17 13:37:09 -07:00
parent 910b84bcd6
commit abc1972600
3 changed files with 6 additions and 3 deletions

View File

@ -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. */

View File

@ -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);

View File

@ -85,6 +85,10 @@ msgstr "Папки"
msgid "Playlists" msgid "Playlists"
msgstr "Списки Воспроизведения" msgstr "Списки Воспроизведения"
#: scanner.c:598
msgid "Recently Added"
msgstr ""
#: scanner.c:536 #: scanner.c:536
msgid "Video" msgid "Video"
msgstr "Видео" msgstr "Видео"