snprintf(dst_child_path, sizeof(dst_child_path), "%s/%%", dst_path);
- select_all_sql = sqlite3_mprintf("SELECT media_uuid, path, thumbnail_path, media_type from media where folder_uuid IN ( SELECT folder_uuid FROM folder where path='%q' or path like '%q');", dst_path, dst_child_path);
+ select_all_sql = sqlite3_mprintf("SELECT media_uuid, path, thumbnail_path, media_type from '%q' where folder_uuid IN ( SELECT folder_uuid FROM folder where path='%q' or path like '%q');", storage_id, dst_path, dst_child_path);
media_svc_debug("[SQL query] : %s", select_all_sql);
char *update_item_sql = NULL;
if (no_thumb) {
- update_item_sql = sqlite3_mprintf("UPDATE media SET path='%q' WHERE media_uuid='%q'", replaced_path, media_uuid);
+ update_item_sql = sqlite3_mprintf("UPDATE '%q' SET path='%q' WHERE media_uuid='%q'", storage_id, replaced_path, media_uuid);
} else {
#if 0
if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE || media_type == MEDIA_SVC_MEDIA_TYPE_VIDEO)
- update_item_sql = sqlite3_mprintf("UPDATE media SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", replaced_path, media_new_thumb_path, media_uuid);
+ update_item_sql = sqlite3_mprintf("UPDATE '%q' SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", storage_id, replaced_path, media_new_thumb_path, media_uuid);
else
- update_item_sql = sqlite3_mprintf("UPDATE media SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", replaced_path, media_thumb_path, media_uuid);
+ update_item_sql = sqlite3_mprintf("UPDATE '%q' SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", storage_id, replaced_path, media_thumb_path, media_uuid);
#else
- update_item_sql = sqlite3_mprintf("UPDATE media SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", replaced_path, media_new_thumb_path, media_uuid);
+ update_item_sql = sqlite3_mprintf("UPDATE '%q' SET path='%q', thumbnail_path='%q' WHERE media_uuid='%q'", storage_id, replaced_path, media_new_thumb_path, media_uuid);
#endif
}