From 1e87003266920e1a1af182fd7d9e4062fcb2815a Mon Sep 17 00:00:00 2001 From: "minje.ahn" Date: Wed, 14 Feb 2024 16:02:42 +0900 Subject: [PATCH] Remove unnecessary handle parameter Removed unnecessary sqlite handle parameter from media_svc_set_storage_validity(). This parameter is for TV product profile. Change-Id: I224e8cc6721b7e7cfe5806a8066984392294adbf Signed-off-by: minje.ahn --- include/media-svc.h | 2 +- plugin/media-content-plugin.c | 4 ++-- src/common/media-svc.c | 11 ++--------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/media-svc.h b/include/media-svc.h index a678833..e91f2ed 100755 --- a/include/media-svc.h +++ b/include/media-svc.h @@ -57,7 +57,7 @@ int media_svc_publish_noti(media_item_update_type_e update_type, const char *pat int media_svc_check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity); int media_svc_insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid); int media_svc_update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid); -int media_svc_set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid); +int media_svc_set_storage_validity(const char *storage_id, int validity, uid_t uid); int media_svc_get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid); int media_svc_set_folder_validity(const char *start_path, int validity, bool is_recursive, uid_t uid); diff --git a/plugin/media-content-plugin.c b/plugin/media-content-plugin.c index eb8853a..580ae0b 100755 --- a/plugin/media-content-plugin.c +++ b/plugin/media-content-plugin.c @@ -80,12 +80,12 @@ int update_storage(sqlite3 *handle, const char *storage_id, const char *storage_ int set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid) { - return media_svc_set_storage_validity(handle, storage_id, validity, uid); + return media_svc_set_storage_validity(storage_id, validity, uid); } int set_all_storage_validity(sqlite3 *handle, int validity, uid_t uid) { - return media_svc_set_storage_validity(handle, NULL, validity, uid); + return media_svc_set_storage_validity(NULL, validity, uid); } int get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid) diff --git a/src/common/media-svc.c b/src/common/media-svc.c index 33a2a2f..a78f53f 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -566,16 +566,9 @@ int media_svc_publish_noti(media_item_update_type_e update_type, const char *pat return _media_svc_publish_noti(update_type, path, media_type, uuid, mime_type); } -int media_svc_set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid) +int media_svc_set_storage_validity(const char *storage_id, int validity, uid_t uid) { - int ret = MS_MEDIA_ERR_NONE; - - media_svc_retvm_if(handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL"); - - ret = _media_svc_update_storage_validity(storage_id, validity, uid); - media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "update storage validity failed: %d", ret); - - return ret; + return _media_svc_update_storage_validity(storage_id, validity, uid); } int media_svc_get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid) -- 2.7.4