Remove media type checker 14/319714/1 accepted/tizen/unified/20250218.161800 accepted/tizen/unified/x/20250221.042211
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 17 Feb 2025 01:33:48 +0000 (10:33 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 17 Feb 2025 01:33:48 +0000 (10:33 +0900)
Moved the checker to libmedia-service.

Change-Id: I2a5fff6a9d8d7eaaa22c436907df3717f933c39c
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
CMakeLists.txt
include/media_util_private.h
include_product/media_util_private.h
packaging/capi-content-media-content.spec
src/media_content.c
src/media_info.c
src/media_util_private.c

index e1b172e0f83a1d77a5db6ec1aa1ee22e9535e98b..6f63b7593e4597e82788a4160d513a9a7ec3d3d8 100644 (file)
@@ -12,7 +12,7 @@ ELSE()
 ENDIF(TIZEN_PRODUCT_TV)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-SET(dependents "dlog glib-2.0 libmedia-service libmedia-utils capi-base-common capi-system-info sqlite3")
+SET(dependents "dlog glib-2.0 libmedia-service libmedia-utils capi-base-common sqlite3")
 SET(pc_dependents "capi-base-common")
 
 INCLUDE(FindPkgConfig)
index ea7f6969681232bd2b1a0ba04900b1c442275722..d4208f9813fbbac98cf150760d0a825286d7c879 100644 (file)
@@ -29,7 +29,6 @@ extern "C" {
 /**
  *@internal
  */
-bool _media_util_check_support_media_type(const char *path);
 int _media_util_check_file_exist(const char *path);
 int _media_util_get_file_time(const char *path);
 bool _media_util_is_ignorable_file(const char *path);
index ea7f6969681232bd2b1a0ba04900b1c442275722..d4208f9813fbbac98cf150760d0a825286d7c879 100644 (file)
@@ -29,7 +29,6 @@ extern "C" {
 /**
  *@internal
  */
-bool _media_util_check_support_media_type(const char *path);
 int _media_util_check_file_exist(const char *path);
 int _media_util_get_file_time(const char *path);
 bool _media_util_is_ignorable_file(const char *path);
index 6c64be25933c16c699139fa590343c34d049e026..6ff0178bc265c07eb4da219ed335f61e72f691a2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-content-media-content
 Summary:    A Media content library in Tizen Native API
-Version:    0.6.4
+Version:    0.6.5
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
@@ -10,7 +10,6 @@ BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(capi-base-common)
-BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(libmedia-service)
 BuildRequires:  pkgconfig(libmedia-utils)
 BuildRequires:  pkgconfig(libtzplatform-config)
index 813989ec8804b5f6e50de242e4bb973223a261d7..4352b62f6c6c781f17a912e09d58974c66630f24 100644 (file)
@@ -108,6 +108,8 @@ int _content_error_capi(int internal_error)
                return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
        case MS_MEDIA_ERR_THUMB_UNSUPPORTED:
                return MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT;
+       case MS_MEDIA_ERR_UNSUPPORTED_CONTENT:
+               return MEDIA_CONTENT_ERROR_NOT_SUPPORTED;
        default:
                return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
        }
@@ -210,7 +212,6 @@ int media_content_scan_file(const char *path)
 
        folder_path = g_path_get_dirname(path);
        content_retv_if(_media_util_is_ignorable_dir(folder_path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-       content_retvm_if(!_media_util_check_support_media_type(path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported type");
 
        ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), path);
        if (ret == MS_MEDIA_ERR_NONE) {
index bf532e299fd2c3dd5712a20abdf29bc08abc720e..30a9f42fa4971e4ebf467aa9c829df5e7440dfab 100644 (file)
@@ -87,12 +87,6 @@ static int __media_info_insert_batch(const char **path_array,
                if (ret != MEDIA_CONTENT_ERROR_NONE)
                        goto ERROR;
 
-               if (!_media_util_check_support_media_type(path_array[idx])) {
-                       content_error("Not supported type: index[%d]", idx);
-                       ret = MEDIA_CONTENT_ERROR_NOT_SUPPORTED;
-                       goto ERROR;
-               }
-
                size = strlen(path_array[idx]);
                if (fwrite(path_array[idx], 1, size, fp) != size) {
                        content_stderror("failed to write");
@@ -301,8 +295,6 @@ int media_info_insert_to_db(const char *path, media_info_h *info)
                        }
                }
        } else if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
-               content_retvm_if(!_media_util_check_support_media_type(path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported media type");
-
                ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_id, path, _content_get_uid());
                if (ret != MS_MEDIA_ERR_NONE) {
                        if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) {
index e9a54cd431cebc64222790fe7cec256e65a940bc..ac46cebdd3d5a9f318187aa93a18e295441056e8 100644 (file)
 #include <dirent.h>
 #include <fcntl.h>
 #include <media_info_private.h>
-#include <system_info.h>
 #include <sys/stat.h>
 
-static int MEDIA_CONTENT_OTHER_SUPPORT = -1;
-
-bool _media_util_check_support_media_type(const char *path)
-{
-       int ret = SYSTEM_INFO_ERROR_NONE;
-       int media_type = -1;
-       bool is_supported = false;
-
-       content_retvm_if(!STRING_VALID(path), false, "path is empty");
-
-       if (MEDIA_CONTENT_OTHER_SUPPORT == -1) {
-               ret = system_info_get_platform_bool("http://tizen.org/feature/content.scanning.others", &is_supported);
-               content_retvm_if(ret != SYSTEM_INFO_ERROR_NONE, false, "SYSTEM_INFO_ERROR: content.scanning.others [%d]", ret);
-
-               MEDIA_CONTENT_OTHER_SUPPORT = is_supported;
-       }
-
-       if (!MEDIA_CONTENT_OTHER_SUPPORT) {
-               ret = media_svc_get_media_type(path, &media_type);
-               content_retvm_if(ret != MS_MEDIA_ERR_NONE, false, "Failed to get media type");
-               content_retv_if(media_type == MEDIA_CONTENT_TYPE_OTHERS, false);
-       }
-
-       return true;
-}
-
 int _media_util_check_file_exist(const char *path)
 {
        int fd = open(path, O_RDONLY);