X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmedia_folder.c;h=60917986ce853a71240d07ff04f18b900ec8c5fc;hb=b8eb368f062a565ea9d5a07a9222e41afd7cfe12;hp=2a6cdb384fb28934b3f769231b57af09eb639dbe;hpb=20e9cd7816214d413dbf408cf435f0508b564f5a;p=platform%2Fcore%2Fapi%2Fmedia-content.git diff --git a/src/media_folder.c b/src/media_folder.c index 2a6cdb3..6091798 100755 --- a/src/media_folder.c +++ b/src/media_folder.c @@ -253,54 +253,6 @@ int media_folder_set_name(media_folder_h folder, const char *name) return ret; } -int media_folder_insert_to_db(const char *path) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; - - content_retip_if_fail(STRING_VALID(path)); - - content_retvm_if(_media_util_is_ignorable_dir(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path"); - - ret = _media_content_check_dir(path); - content_retvm_if(ret == MEDIA_CONTENT_ERROR_PERMISSION_DENIED, ret, "Permission Denied"); - content_retvm_if(ret == MEDIA_CONTENT_ERROR_INVALID_PARAMETER, ret, "invalid path[%s]", path); - - ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - content_error("media_svc_get_storage_id failed : %d", ret); - return _content_error_capi(ret); - } - - ret = media_svc_check_folder_exist_by_path(_content_get_db_handle(), storage_id, path); - if (ret == MS_MEDIA_ERR_DB_NO_RECORD) { - content_sec_debug("media_svc_check_folder_exist_by_path : no record : %s", path); - - ret = media_svc_insert_folder(_content_get_db_handle(), storage_id, path, false, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) { - content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", path); - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - content_sec_error("media_svc_insert_folder failed : %d (%s)", ret, path); - } - - return _content_error_capi(ret); - } - - ret = media_svc_set_folder_scan_status(storage_id, path, MEDIA_DIR_SCAN_DONE, false, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - content_sec_error("media_svc_set_folder_scan_status failed : %d", ret); - return _content_error_capi(ret); - } - } else if (ret != MS_MEDIA_ERR_NONE) { - content_sec_error("media_svc_check_folder_exist_by_path failed : %d (%s)", ret, path); - return _content_error_capi(ret); - } - - return ret; -} - int media_folder_get_scan_status(const char *storage_uuid, char* path, media_folder_scan_status_e *scan_status) { int ret = MEDIA_CONTENT_ERROR_NONE;