Remove plugin API for scanner-v2 only 57/196257/2
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 26 Dec 2018 23:47:24 +0000 (08:47 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Fri, 28 Dec 2018 02:05:51 +0000 (11:05 +0900)
Change-Id: I4747057f686b88018e5c31f9eda9dae0f4c86189
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media-svc.h
plugin/media-content-plugin.c
src/common/media-svc-db-utils.c
src/common/media-svc-media-folder.c
src/common/media-svc.c
src/include/common/media-svc-db-utils.h

index 271fb95..6d3d065 100755 (executable)
@@ -35,7 +35,6 @@ extern "C" {
 #endif
 
 
-int media_svc_cleanup_db(sqlite3 *handle, uid_t uid);
 int media_svc_get_user_version(sqlite3 *handle, int *user_version);
 int media_svc_create_table(uid_t uid);
 int media_svc_check_item_exist_by_path(sqlite3 *handle, const char *storage_id, const char *path);
index 46bb1f6..05175e0 100755 (executable)
@@ -28,7 +28,8 @@
 
 int cleanup_db(sqlite3 *handle, uid_t uid)
 {
-       return media_svc_cleanup_db(handle, uid);
+       /* For scanner V2 */
+       return MS_MEDIA_ERR_NONE;
 }
 
 int check_item_exist(sqlite3 *handle, const char *storage_id, const char *file_path, bool *modified)
index 51cb88b..81e460f 100755 (executable)
@@ -1336,54 +1336,6 @@ int _media_svc_get_user_version(sqlite3 *db_handle, int *user_version)
        return MS_MEDIA_ERR_NONE;
 }
 
-int _media_svc_do_cleanup(sqlite3 *db_handle, uid_t uid)
-{
-       int ret = MS_MEDIA_ERR_NONE;
-       sqlite3_stmt *sql_stmt = NULL;
-       GList *sql_list = NULL;
-       int item_cnt = 0;
-       int idx = 0;
-       /*Make one query to drop table, delete folder, delete storage.. And only for external USB storage */
-       char *sql = sqlite3_mprintf("select 'DROP TABLE ''' || storage_uuid || ''';DELETE FROM folder WHERE storage_uuid = ''' || storage_uuid || ''';DELETE FROM storage WHERE storage_uuid = ''' || storage_uuid || ''';' from storage where validity = 0 AND storage_type=2;");
-
-       ret = _media_svc_sql_prepare_to_step_simple(db_handle, sql, &sql_stmt);
-       if (ret != MS_MEDIA_ERR_NONE) {
-               media_svc_error("error when get user_version.");
-               return ret;
-       }
-
-       while (sqlite3_step(sql_stmt) == SQLITE_ROW) {
-               if (STRING_VALID((const char *)sqlite3_column_text(sql_stmt, 0)))
-                       sql_list = g_list_append(sql_list, strdup((char *)sqlite3_column_text(sql_stmt, 0)));
-       }
-
-       SQLITE3_FINALIZE(sql_stmt);
-
-       if ((sql_list != NULL) && (g_list_length(sql_list) > 0)) {
-               item_cnt = g_list_length(sql_list);
-
-               for (idx = 0; idx < item_cnt; idx++) {
-                       char *query = NULL;
-                       query = g_list_nth_data(sql_list, idx);
-
-                       if (STRING_VALID(query)) {
-                               sql = sqlite3_mprintf("%s", query);
-                               _media_svc_sql_query(sql, uid);
-                               SQLITE3_SAFE_FREE(sql);
-                               SAFE_FREE(query);
-                       }
-               }
-               g_list_free(sql_list);
-       }
-
-       /*Rebuild index*/
-       sql = sqlite3_mprintf("VACUUM;");
-       _media_svc_sql_query(sql, uid);
-       SQLITE3_SAFE_FREE(sql);
-
-       return MS_MEDIA_ERR_NONE;
-}
-
 int _media_svc_sql_prepare_to_step(sqlite3 *handle, const char *sql_str, sqlite3_stmt **stmt)
 {
        int err = -1;
index 98491de..e79014a 100755 (executable)
@@ -27,8 +27,6 @@
 #include "media-svc-util.h"
 #include "media-svc-db-utils.h"
 
-#define FOLDER_SCAN_DONE 4
-
 static __thread GList *g_media_svc_insert_folder_query_list;
 
 int _media_svc_get_folder_id_by_foldername(sqlite3 *handle, const char *storage_id, const char *folder_name, char *folder_id, uid_t uid)
index ca2daff..6bf0a89 100755 (executable)
@@ -49,13 +49,6 @@ static __thread int g_insert_with_noti = FALSE;
 
 #define BATCH_REQUEST_MAX 300
 
-int media_svc_cleanup_db(sqlite3 *handle, uid_t uid)
-{
-       media_svc_debug_fenter();
-
-       return _media_svc_do_cleanup(handle, uid);
-}
-
 int media_svc_get_user_version(sqlite3 *handle, int *user_version)
 {
        return _media_svc_get_user_version(handle, user_version);
index f9117f8..816b3b8 100755 (executable)
@@ -37,7 +37,6 @@ int _media_svc_create_media_table_with_id(const char *table_id, uid_t uid);
 int _media_svc_update_media_view(sqlite3 *db_handle, uid_t uid);
 int _media_svc_sql_query(const char *sql_str, uid_t uid);
 int _media_svc_get_user_version(sqlite3 *db_handle, int *user_version);
-int _media_svc_do_cleanup(sqlite3 *db_handle, uid_t uid);
 int _media_svc_sql_prepare_to_step(sqlite3 *handle, const char *sql_str, sqlite3_stmt **stmt);
 int _media_svc_sql_prepare_to_step_simple(sqlite3 *handle, const char *sql_str, sqlite3_stmt **stmt);
 int _media_svc_sql_begin_trans(uid_t uid);