diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2019-01-29 14:27:55 +0900 |
---|---|---|
committer | Minje Ahn <minje.ahn@samsung.com> | 2019-01-29 14:27:55 +0900 |
commit | b6d52f1ee953b3ccbd7aaa76db1d043a44dce16b (patch) | |
tree | adf0b2c554cd2cb8a54802262faa4988af9927ac /src | |
parent | 8ec621205756e2c313df940845f416611e421b4b (diff) | |
download | libmedia-service-b6d52f1ee953b3ccbd7aaa76db1d043a44dce16b.tar.gz libmedia-service-b6d52f1ee953b3ccbd7aaa76db1d043a44dce16b.tar.bz2 libmedia-service-b6d52f1ee953b3ccbd7aaa76db1d043a44dce16b.zip |
Move set_folder_item_validitysubmit/tizen/20190129.064431
Move plugin to media-common
Change-Id: I17e60de39312f20282be171b08c21ba92babb1f0
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/common/media-svc-media.c | 51 | ||||
-rwxr-xr-x | src/common/media-svc.c | 8 | ||||
-rwxr-xr-x | src/include/common/media-svc-media.h | 2 |
3 files changed, 0 insertions, 61 deletions
diff --git a/src/common/media-svc-media.c b/src/common/media-svc-media.c index 6517727..29918ed 100755 --- a/src/common/media-svc-media.c +++ b/src/common/media-svc-media.c @@ -455,57 +455,6 @@ int _media_svc_update_thumbnail_path(const char *storage_id, const char *path, c return ret; } -int _media_svc_update_folder_item_validity(sqlite3 *handle, const char *storage_id, const char *folder_path, int validity, uid_t uid) -{ - int ret = MS_MEDIA_ERR_NONE; - char *sql = NULL; - char folder_uuid[MEDIA_SVC_UUID_SIZE + 1] = {0, }; - sqlite3_stmt *sql_stmt = NULL; - - media_svc_retvm_if(!STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL"); - media_svc_retvm_if(!STRING_VALID(folder_path), MS_MEDIA_ERR_INVALID_PARAMETER, "folder_path is NULL"); - - /*Get folder ID*/ - sql = sqlite3_mprintf("SELECT folder_uuid FROM '%q' WHERE path='%q' AND storage_uuid='%q'", MEDIA_SVC_DB_TABLE_FOLDER, folder_path, storage_id); - - ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt); - if (ret != MS_MEDIA_ERR_NONE) { - if (ret == MS_MEDIA_ERR_DB_NO_RECORD) - media_svc_debug("folder not exist"); - else - media_svc_error("error when get folder_id. err = [%d]", ret); - - return ret; - } - - SAFE_STRLCPY(folder_uuid, (const char *)sqlite3_column_text(sql_stmt, 0), MEDIA_SVC_UUID_SIZE + 1); - SQLITE3_FINALIZE(sql_stmt); - - /*Update folder item validity*/ - sql = sqlite3_mprintf("UPDATE '%q' SET validity=%d WHERE folder_uuid='%q';", storage_id, validity, folder_uuid); - - ret = _media_svc_sql_query(sql, uid); - SQLITE3_SAFE_FREE(sql); - - return ret; -} - -int _media_svc_update_recursive_folder_item_validity(const char *storage_id, const char *folder_path, int validity, uid_t uid) -{ - int ret = MS_MEDIA_ERR_NONE; - - media_svc_retvm_if(!STRING_VALID(storage_id), MS_MEDIA_ERR_INVALID_PARAMETER, "storage_id is NULL"); - media_svc_retvm_if(!STRING_VALID(folder_path), MS_MEDIA_ERR_INVALID_PARAMETER, "folder_path is NULL"); - - /*Update folder item validity*/ - char *sql = sqlite3_mprintf("UPDATE '%q' SET validity=%d WHERE (storage_type = 0 OR storage_type = 1) AND path LIKE '%q/%%';", storage_id, validity, folder_path); - - ret = _media_svc_sql_query(sql, uid); - SQLITE3_SAFE_FREE(sql); - - return ret; -} - int _media_svc_update_item_by_path(const char *org_storage_id, const char *src_path, const char *dst_storage_id, ms_user_storage_type_e dest_storage, const char *dest_path, const char *file_name, int modified_time, const char *folder_uuid, uid_t uid) { /* update path, filename, modified_time, folder_uuid, thumbnail_path, */ diff --git a/src/common/media-svc.c b/src/common/media-svc.c index 49974ae..bc0fd96 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -582,14 +582,6 @@ int media_svc_delete_item_by_path(sqlite3 *handle, const char *storage_id, const return MS_MEDIA_ERR_NONE; } -int media_svc_set_folder_items_validity(sqlite3 *handle, const char *storage_id, const char *folder_path, int validity, int recursive, uid_t uid) -{ - if (recursive) - return _media_svc_update_recursive_folder_item_validity(storage_id, folder_path, validity, uid); - else - return _media_svc_update_folder_item_validity(handle, storage_id, folder_path, validity, uid); -} - int media_svc_refresh_item(sqlite3 *handle, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, uid_t uid) { int ret = MS_MEDIA_ERR_NONE; diff --git a/src/include/common/media-svc-media.h b/src/include/common/media-svc-media.h index fd0d007..091b496 100755 --- a/src/include/common/media-svc-media.h +++ b/src/include/common/media-svc-media.h @@ -34,8 +34,6 @@ int _media_svc_update_item_with_data(const char *storage_id, media_svc_content_i int _media_svc_get_thumbnail_path_by_path(sqlite3 *handle, const char *path, char *thumbnail_path); int _media_svc_get_media_type_by_path(sqlite3 *handle, const char *storage_id, const char *path, int *media_type); int _media_svc_delete_item_by_path(const char *storage_id, const char *path, bool stack_query, uid_t uid); -int _media_svc_update_folder_item_validity(sqlite3 *handle, const char *storage_id, const char *folder_path, int validity, uid_t uid); -int _media_svc_update_recursive_folder_item_validity(const char *storage_id, const char *folder_path, int validity, uid_t uid); int _media_svc_update_item_validity(const char *storage_id, const char *path, int validity, bool stack_query, uid_t uid); int _media_svc_update_item_by_path(const char *org_storage_id, const char *src_path, const char *dst_storage_id, ms_user_storage_type_e dest_storage, const char *dest_path, const char *file_name, int modified_time, const char *folder_uuid, uid_t uid); int _media_svc_list_query_do(media_svc_query_type_e query_type, uid_t uid); |