-
- /* Set modified time */
- time_t date;
- time(&date);
- _folder->modified_time = date;
-
- /*Update Pinyin If Support Pinyin*/
- media_svc_check_pinyin_support(&pinyin_support);
- if (pinyin_support)
- media_svc_get_pinyin(_folder->name, &name_pinyin);
-
- sql = sqlite3_mprintf("UPDATE %Q SET path='%q', name='%q', modified_time=%d, name_pinyin='%q' WHERE folder_uuid=%Q",
- DB_TABLE_FOLDER, repl_path, _folder->name, _folder->modified_time, name_pinyin, _folder->folder_id);
-
- ret = _content_query_sql(sql);
- SQLITE3_SAFE_FREE(sql);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SAFE_FREE(g_src_path);
- return ret;
- }
-
- /* Update all folder record's path, which are matched by old parent path */
- char *update_folder_path_sql = NULL;
- char src_path_slash[MAX_PATH_LEN + 1] = {0, };
- char dst_path_slash[MAX_PATH_LEN + 1] = {0, };
-
- snprintf(src_path_slash, sizeof(src_path_slash), "%s/", g_src_path);
- snprintf(dst_path_slash, sizeof(dst_path_slash), "%s/", repl_path);
-
- update_folder_path_sql = sqlite3_mprintf("UPDATE folder SET path = REPLACE( path, '%q', '%q');", src_path_slash, dst_path_slash);
-
- ret = _content_query_sql(update_folder_path_sql);
- SQLITE3_SAFE_FREE(update_folder_path_sql);