Move logic for reset mediadb
[platform/core/multimedia/libmedia-service.git] / plugin / media-content-plugin.c
index ca8e2f4..f40aa14 100755 (executable)
@@ -120,6 +120,24 @@ int disconnect_db(void *handle, char **err_msg)
        return MEDIA_SVC_PLUGIN_ERROR_NONE;
 }
 
+int cleanup_db(void *handle, uid_t uid, char **err_msg)
+{
+       int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;
+
+       if (handle == NULL) {
+               __set_error_message(ERR_HANDLE, err_msg);
+               return MEDIA_SVC_PLUGIN_ERROR;
+       }
+
+       ret = media_svc_cleanup_db(handle, uid);
+       if (ret < 0) {
+               __set_error_message(ret, err_msg);
+               return MEDIA_SVC_PLUGIN_ERROR;
+       }
+
+       return MEDIA_SVC_PLUGIN_ERROR_NONE;
+}
+
 int check_item_exist(void *handle, const char *storage_id, const char *file_path, bool *modified, char **err_msg)
 {
        int ret = MEDIA_SVC_PLUGIN_ERROR_NONE;