char *folder_name_pinyin = NULL;
if (_media_svc_check_pinyin_support())
_media_svc_get_pinyin_str(folder_name, &folder_name_pinyin);
-
- char *sql = sqlite3_mprintf("INSERT INTO %s (folder_uuid, path, name, storage_uuid, storage_type, modified_time, name_pinyin, parent_folder_uuid) \
+ /* Sometime SQLITE3 returns NO_RECORD, so need to consider conflict case.. */
+ media_svc_debug("UNIQUE:path[%s], storage_uuid[%s]", folder_path, storage_id);
+ char *sql = sqlite3_mprintf("INSERT OR IGNORE INTO %s (folder_uuid, path, name, storage_uuid, storage_type, modified_time, name_pinyin, parent_folder_uuid) \
values (%Q, %Q, %Q, %Q, '%d', '%d', %Q, %Q); ",
MEDIA_SVC_DB_TABLE_FOLDER, folder_id, folder_path, folder_name, storage_id, storage_type, folder_modified_date, folder_name_pinyin, parent_folder_uuid);