ret = _media_content_replace_path(_media->file_path, org_repl_path);
media_content_retvm_if(!STRING_VALID(org_repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed");
+ /* If dst_path is folder, append file_name */
+ if (g_file_test(repl_path, G_FILE_TEST_IS_DIR)) {
+ if (repl_path[strlen(repl_path) - 1] != '/')
+ SAFE_STRLCAT(repl_path, "/", sizeof(repl_path));
+
+ SAFE_STRLCAT(repl_path, _media->display_name, sizeof(repl_path));
+ }
+
/* If the two paths are the same, do nothing */
media_content_retvm_if(g_strcmp0(repl_path, org_repl_path) == 0, MEDIA_CONTENT_ERROR_NONE, "Same path");