'folder_modified_time' in folder table is no longer used.
Deleted the relevant code.
Change-Id: I9c423296619e8cf6dcd5807faf7dc30fc490df5e
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
#include <sqlite3.h>
#include <stdbool.h>
-int _media_svc_update_folder_modified_time(const char *folder_path, uid_t uid);
int _media_svc_get_and_append_folder_id_by_path(sqlite3 *handle, bool is_direct, const char *storage_id, const char *path, long long int *folder_id, uid_t uid);
int _media_svc_append_by_folder_path(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid);
int _media_svc_set_folder_validity(bool is_direct, const char *start_path, int validity, bool is_recursive, uid_t uid);
char *mime_type; /**< Full path and file name of media file */
unsigned long long size; /**< size */
time_t modified_time; /**< modified time, time_t */
- long long int folder_id; /**< Unique ID of folder */
- int album_id; /**< Unique ID of album */
+ long long int folder_id; /**< Folder ID */
+ int album_id; /**< Album ID */
char *thumbnail_path; /**< Thumbnail image file path */
char *storage_uuid; /**< Unique ID of storage */
media_svc_content_meta_s media_meta; /**< meta data structure */
Name: libmedia-service
Summary: Media information service library for multimedia applications
-Version: 0.6.2
+Version: 0.6.3
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
__add_column_info(&column_list[DB_LIST_FOLDER], "folder_id", DB_TYPE_INT, "PRIMARY KEY AUTOINCREMENT", false, false, false);
__add_column_info(&column_list[DB_LIST_FOLDER], "folder_path", DB_TYPE_TEXT, "NOT NULL", true, false, false);
__add_column_info(&column_list[DB_LIST_FOLDER], "folder_name", DB_TYPE_TEXT, "NOT NULL", false, false, false);
- __add_column_info(&column_list[DB_LIST_FOLDER], "folder_modified_time", DB_TYPE_INT, "DEFAULT 0", false, false, false);
__add_column_info(&column_list[DB_LIST_FOLDER], "storage_uuid", DB_TYPE_TEXT, NULL, true, false, false);
__add_column_info(&column_list[DB_LIST_FOLDER], "validity", DB_TYPE_INT, "DEFAULT 1", false, false, false);
ret = _media_svc_get_result_with_check_record(handle, sql, &sql_stmt);
SQLITE3_SAFE_FREE(sql);
- media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "_media_svc_get_result_with_check_record failed [%d]", ret);
+ media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "failed to get folder id[%d]", ret);
*folder_id = sqlite3_column_int64(sql_stmt, 0);
{
int ret = MS_MEDIA_ERR_NONE;
char *folder_name = NULL;
- int folder_modified_date = 0;
folder_name = g_path_get_basename(folder_path);
- folder_modified_date = _media_svc_get_file_time(folder_path);
/* Sometime SQLITE3 returns NO_RECORD, so need to consider conflict case.. */
- char *sql = sqlite3_mprintf("INSERT OR IGNORE INTO %q(folder_path, folder_name, storage_uuid, folder_modified_time) VALUES (%Q, %Q, %Q, %d);",
- DB_TABLE_FOLDER, folder_path, folder_name, storage_id, folder_modified_date);
+ char *sql = sqlite3_mprintf("INSERT OR IGNORE INTO %q(folder_path, folder_name, storage_uuid) VALUES (%Q, %Q, %Q);",
+ DB_TABLE_FOLDER, folder_path, folder_name, storage_id);
if (is_direct)
ret = _media_svc_sql_query_direct(sql, uid);
return ret;
}
-int _media_svc_update_folder_modified_time(const char *folder_path, uid_t uid)
-{
- int ret = MS_MEDIA_ERR_NONE;
- int time = 0;
- char *query = NULL;
-
- time = _media_svc_get_file_time(folder_path);
- query = sqlite3_mprintf("UPDATE %q SET folder_modified_time=%d WHERE folder_path=%Q", DB_TABLE_FOLDER, time, folder_path);
-
- ret = _media_svc_sql_query(query, uid);
- SQLITE3_SAFE_FREE(query);
-
- return ret;
-}
-
static int __media_svc_append_parent_folder(sqlite3 *handle, bool is_direct, const char *storage_id, const char *path, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
return g_strdup(uuid_unparsed);
}
-static char * __media_svc_get_exif_datetaken(ExifData *ed)
-{
- ExifEntry *entry;
- char tmp[MEDIA_SVC_METADATA_LEN_MAX + 1] = { 0, };
-
- media_svc_retv_if(!ed, NULL);
-
- entry = exif_data_get_entry(ed, EXIF_TAG_DATE_TIME_ORIGINAL);
- if (entry) {
- exif_entry_get_value(entry, tmp, MEDIA_SVC_METADATA_LEN_MAX);
- if (strlen(tmp) > 0)
- return g_strdup(tmp);
- }
-
- entry = exif_data_get_entry(ed, EXIF_TAG_DATE_TIME);
- if (entry) {
- exif_entry_get_value(entry, tmp, MEDIA_SVC_METADATA_LEN_MAX);
- if (strlen(tmp) > 0)
- return g_strdup(tmp);
- }
-
- return NULL;
-}
-
-static bool __media_svc_get_exif_short(ExifData *ed, ExifTag tagtype, unsigned short *value)
-{
- ExifEntry *entry;
-
- media_svc_retv_if(!ed, false);
- media_svc_retvm_if(!value, false, "value is NULL");
-
- entry = exif_data_get_entry(ed, tagtype);
- media_svc_retv_if(!entry, false);
- *value = exif_get_short(entry->data, exif_data_get_byte_order(ed));
-
- return true;
-}
-
static int __media_svc_get_media_type(const char *path, const char *mime_type, media_svc_media_type_e *media_type)
{
int idx = 0;
return __media_svc_get_title_from_filename(filename);
}
+static char * __media_svc_get_exif_datetaken(ExifData *ed)
+{
+ ExifEntry *entry;
+ char tmp[MEDIA_SVC_METADATA_LEN_MAX + 1] = { 0, };
+
+ media_svc_retv_if(!ed, NULL);
+
+ entry = exif_data_get_entry(ed, EXIF_TAG_DATE_TIME_ORIGINAL);
+ if (entry) {
+ exif_entry_get_value(entry, tmp, MEDIA_SVC_METADATA_LEN_MAX);
+ if (strlen(tmp) > 0)
+ return g_strdup(tmp);
+ }
+
+ entry = exif_data_get_entry(ed, EXIF_TAG_DATE_TIME);
+ if (entry) {
+ exif_entry_get_value(entry, tmp, MEDIA_SVC_METADATA_LEN_MAX);
+ if (strlen(tmp) > 0)
+ return g_strdup(tmp);
+ }
+
+ return NULL;
+}
+
+static bool __media_svc_get_exif_short(ExifData *ed, ExifTag tagtype, unsigned short *value)
+{
+ ExifEntry *entry;
+
+ media_svc_retv_if(!ed, false);
+ media_svc_retvm_if(!value, false, "value is NULL");
+
+ entry = exif_data_get_entry(ed, tagtype);
+ media_svc_retv_if(!entry, false);
+ *value = exif_get_short(entry->data, exif_data_get_byte_order(ed));
+
+ return true;
+}
+
int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info)
{
unsigned short orient_value = 0;
{
int ret = MS_MEDIA_ERR_NONE;
char *file_name = NULL;
- char *folder_path = NULL;
int modified_time = 0;
long long int folder_id = 0;
char old_thumb_path[MEDIA_SVC_PATHNAME_SIZE] = {0, };
media_svc_debug("Move is successful. Sending noti for this");
_media_svc_publish_noti(MS_MEDIA_ITEM_UPDATE, src_path, media_type, media_id, mime_type);
- /*update folder modified_time*/
- folder_path = g_path_get_dirname(dest_path);
- ret = _media_svc_update_folder_modified_time(folder_path, uid);
- g_free(folder_path);
- media_svc_retv_if(ret != MS_MEDIA_ERR_NONE, ret);
-
return MS_MEDIA_ERR_NONE;
}