Remove media type checker 10/319710/1 accepted/tizen/unified/20250218.161756 accepted/tizen/unified/x/20250221.042128
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 17 Feb 2025 01:26:49 +0000 (10:26 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 17 Feb 2025 01:26:49 +0000 (10:26 +0900)
Move the checker to libmedia-service.

Change-Id: I732c94f203c40fe74d1f3fc2942a0e86d816621f
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/media-server.spec
src/common/include/media-common-db-svc.h
src/common/media-common-db-svc.c
src/scanner-v2/media-scanner-scan-v2.c
src/scanner/media-scanner-scan.c
src/server/media-server-main.c

index 7873e4e5c75f06a4847aa4c241d3e574ef81fe62..2ac509cf9ba3de6a6331bf0380caa6afeadd5357 100644 (file)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.6.12
+Version:    0.6.13
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index f3ced359fe67a2a53c227bf32c4db0a761ee675c..be1c08ec9f37763fd9ffe41f21cec2f53b27d0f5 100644 (file)
@@ -20,7 +20,6 @@
 #define _MEDIA_COMMON_DB_SVC_H_
 
 #include <glib.h>
-#include <system_info.h>
 
 #include "media-common-types.h"
 
@@ -57,8 +56,6 @@ int ms_set_storage_validity(const char *storage_id, int validity, uid_t uid);
 int ms_set_all_storage_validity(int validity, uid_t uid);
 int ms_check_folder_exist(sqlite3 *handle, const char *folder_path);
 int ms_get_folder_id(sqlite3 *handle, const char *storage_id, const char *path, char **folder_id);
-int ms_get_media_type(const char *path, int *media_type);
-bool ms_check_support_media_type(const char *path);
 void ms_register_start(bool noti_status, int pid);
 void ms_register_end(uid_t uid);
 
index c0c0b0869c040b30d2c53c453ba3f7145d913fdf..3b399f80e39031804bf95f8029a84a04436e7817 100644 (file)
@@ -32,7 +32,6 @@
 static GMutex db_mutex;
 static void **func_array;
 static void *func_handle = NULL;
-static int scan_other_type = -1;
 
 typedef int (*INSERT_ITEM_BEGIN)(bool, int);
 typedef int (*INSERT_ITEM_END)(uid_t);
@@ -51,7 +50,6 @@ typedef int (*UPDATE_STORAGE)(sqlite3 *, const char *, const char *, uid_t);
 typedef int (*SET_STORAGE_VALIDITY)(const char *, int, uid_t uid);
 typedef int (*SET_ALL_STORAGE_VALIDITY)(int, uid_t);
 typedef int (*CHECK_FOLDER_EXIST)(sqlite3 *, const char *);
-typedef int (*GET_MEDIA_TYPE)(const char *, int *);
 typedef int (*REFRESH_ITEM)(sqlite3 *, const char *, uid_t);
 
 #ifdef _USE_TVPD_MODE
@@ -86,7 +84,6 @@ enum func_list {
        eSET_STORAGE_VALIDITY,
        eSET_ALL_STORAGE_VALIDITY,
        eCHECK_FOLDER_EXIST,
-       eGET_MEDIA_TYPE,
        eREFRESH_ITEM,
 #ifdef _USE_TVPD_MODE
        eUPDATE_FOLDER_TIME,
@@ -125,7 +122,6 @@ int ms_load_functions(void)
                "set_storage_validity",
                "set_all_storage_validity",
                "check_folder_exist",
-               "get_media_type",
                "refresh_item",
 #ifdef _USE_TVPD_MODE
                "update_folder_time",
@@ -532,45 +528,6 @@ void ms_register_end(uid_t uid)
                MS_DBG_ERR("INSERT_ITEM_END failed [%d]", ret);
 }
 
-int ms_get_media_type(const char *path, int *media_type)
-{
-       int ret = MS_MEDIA_ERR_NONE;
-
-       ret = ((GET_MEDIA_TYPE)func_array[eGET_MEDIA_TYPE])(path, media_type);
-       MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "GET_MEDIA_TYPE failed [%d]", ret);
-
-       return ret;
-}
-
-bool ms_check_support_media_type(const char *path)
-{
-       int ret = SYSTEM_INFO_ERROR_NONE;
-       int media_type = -1;
-       bool is_supported = false;
-
-       MS_DBG_RETVM_IF(!MS_STRING_VALID(path), false, "path is empty");
-
-       if (scan_other_type == -1) {
-               ret = system_info_get_platform_bool("http://tizen.org/feature/content.scanning.others", &is_supported);
-               if (ret != SYSTEM_INFO_ERROR_NONE) {
-                       MS_DBG_ERR("SYSTEM_INFO_ERROR: content.scanning.others [%d]", ret);
-                       return false;
-               }
-
-               scan_other_type = is_supported;
-       }
-
-       if (!scan_other_type) {
-               ret = ms_get_media_type(path, &media_type);
-               MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, false, "Failed to get media type");
-
-               if (media_type == MS_MEDIA_TYPE_OTHER)
-                       return false;
-       }
-
-       return true;
-}
-
 #ifdef _USE_TVPD_MODE
 int ms_set_subfolder_validity(sqlite3 *handle, const char *path, int validity, uid_t uid)
 {
index 3ee0e77463df8fa6048fed5511063fbc12fc26f0..8866faf82c82b35146acc60e1a54b07cd37faa29 100644 (file)
@@ -300,9 +300,6 @@ static int __msc_dir_scan_for_folder(sqlite3 *handle, const char *storage_id, ch
                        }
 
                        if (dir_entry->d_type == DT_REG) {
-                               if (!ms_check_support_media_type(path))
-                                       continue;
-
                                ret = ms_validate_item(handle, storage_id, path, uid);
                                if (ret != MS_MEDIA_ERR_NONE) {
                                        MS_DBG_ERR("failed to update db : %d", ret);
@@ -510,9 +507,6 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
                        }
 
                        if (dir_entry->d_type == DT_REG) {
-                               if (!ms_check_support_media_type(path))
-                                       continue;
-
                                ret = scan_function(handle, storage_id, path, uid);
                                if (ret != MS_MEDIA_ERR_NONE) {
                                        MS_DBG_ERR("failed to update db : %d", msg_type);
index 163d3fedbdcfad5db3641961dcc554225ed4723d..4390fa0e982624a5268bf9df38f588fb52c25d75 100644 (file)
@@ -93,12 +93,6 @@ static int __msc_dir_scan(sqlite3 *handle, const char *storage_id, char *start_p
 
                        switch (dir_entry->d_type) {
                        case DT_REG:
-                               /* Check content.scanning.others feature */
-                               if (!ms_check_support_media_type(path)) {
-                                       MS_DBG("Unsupported media type");
-                                       continue;
-                               }
-
                                if (scan_function(handle, storage_id, path, uid) != MS_MEDIA_ERR_NONE)
                                        MS_DBG_ERR("failed to update db");
                                break;
index 9386ff1d86b636faa46c660fc2bebbabd42dd11d..2b8f301bc8b100bb593be0c49be91fa64ea46890 100644 (file)
@@ -22,6 +22,7 @@
 #include <malloc.h>
 #include <cpu-boosting.h>
 #include <unistd.h>
+#include <system_info.h>
 
 #include "media-util.h"
 #include "media-common-utils.h"