typedef struct {
char *storage_id;
- char *storage_name;
char *storage_path;
int storage_type;
} media_storage_s;
/* Storage*/
#define SELECT_STORAGE_COUNT "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_LIST "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_INFO_FROM_STORAGE "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_uuid='%s'"
+#define SELECT_STORAGE_LIST "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1"
+#define SELECT_STORAGE_INFO_FROM_STORAGE "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_uuid='%s'"
/* Face */
#define DELETE_FACE_FROM_FACE "DELETE FROM "DB_TABLE_FACE" WHERE face_uuid='%q'"
typedef struct {
char *storage_id;
- char *storage_name;
char *storage_path;
int storage_type;
} media_storage_s;
/* Storage*/
#define SELECT_STORAGE_COUNT "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_LIST "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_INFO_FROM_STORAGE "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_uuid='%s'"
+#define SELECT_STORAGE_LIST "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1"
+#define SELECT_STORAGE_INFO_FROM_STORAGE "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_uuid='%s'"
/* Face */
#define DELETE_FACE_FROM_FACE "DELETE FROM "DB_TABLE_FACE" WHERE face_uuid='%q'"
}
_storage->storage_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
- _storage->storage_name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
- _storage->storage_type = (int)sqlite3_column_int(stmt, 3);
+ _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
+ _storage->storage_type = (int)sqlite3_column_int(stmt, 2);
if (callback((media_storage_h)_storage, user_data) == false) {
media_storage_destroy((media_storage_h) _storage);
#include <media_info_private.h>
-static void __media_storage_get_detail(sqlite3_stmt* stmt, media_storage_h storage)
-{
- media_storage_s *_storage = (media_storage_s*)storage;
-
- _storage->storage_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
- _storage->storage_name = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 2));
- _storage->storage_type = (int)sqlite3_column_int(stmt, 3);
-
- return;
-}
-
int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- __media_storage_get_detail(stmt, (media_storage_h)_storage);
+ _storage->storage_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
+ _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
+ _storage->storage_type = (int)sqlite3_column_int(stmt, 2);
*storage = (media_storage_h)_storage;
}
if (_storage) {
SAFE_FREE(_storage->storage_id);
SAFE_FREE(_storage->storage_path);
- SAFE_FREE(_storage->storage_name);
SAFE_FREE(_storage);
ret = MEDIA_CONTENT_ERROR_NONE;
}
}
- if (STRING_VALID(_src->storage_name)) {
- _dst->storage_name = strdup(_src->storage_name);
- if (_dst->storage_name == NULL) {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- media_storage_destroy((media_storage_h)_dst);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
if (STRING_VALID(_src->storage_path)) {
_dst->storage_path = strdup(_src->storage_path);
if (_dst->storage_path == NULL) {
media_storage_s *_storage = (media_storage_s*)storage;
if (_storage && storage_name) {
- if (STRING_VALID(_storage->storage_name)) {
- *storage_name = strdup(_storage->storage_name);
- media_content_retvm_if(*storage_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- } else {
- *storage_name = NULL;
- }
-
- ret = MEDIA_CONTENT_ERROR_NONE;
+ *storage_name = NULL;
} else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;