Add missing code related recorded_date 41/309641/1 accepted/tizen/unified/20240415.170313 accepted/tizen/unified/x/20240416.023002
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 15 Apr 2024 02:09:12 +0000 (11:09 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Mon, 15 Apr 2024 02:09:12 +0000 (11:09 +0900)
Change-Id: Ic1bbf213ef0571b741e5170fb0ddafab5f406dc9
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media-svc-util.c

index ec2f652..0473704 100644 (file)
@@ -473,6 +473,8 @@ int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info)
 
        content_info->media_meta.datetaken = __media_svc_get_exif_datetaken(ed);
        content_info->media_meta.recorded_date = g_strdup(content_info->media_meta.datetaken);
+       if (content_info->media_meta.recorded_date == NULL)
+               content_info->media_meta.recorded_date = g_strdup(MEDIA_SVC_TAG_UNKNOWN);
 
        if (__media_svc_get_exif_short(ed, EXIF_TAG_ORIENTATION, &orient_value)) {
                if (orient_value <= ROT_270)
@@ -586,6 +588,10 @@ void _media_svc_extract_audio_metadata(sqlite3 *handle, bool is_direct, media_sv
                }
        }
 
+       if (content_info->media_meta.recorded_date == NULL)
+               content_info->media_meta.recorded_date = g_strdup(MEDIA_SVC_TAG_UNKNOWN);
+       content_info->media_meta.datetaken = g_strdup(content_info->media_meta.recorded_date);
+
        mmf_error = mm_file_get_attrs(tag, MM_FILE_TAG_DATE, &p, &size, NULL);
        if (mmf_error == FILEINFO_ERROR_NONE && size == 4)
                content_info->media_meta.year = g_strdup(p);
@@ -630,6 +636,9 @@ void _media_svc_extract_video_metadata(media_svc_content_info_s *content_info)
                                content_info->media_meta.recorded_date = g_strdup(p);
                        }
                }
+               if (content_info->media_meta.recorded_date == NULL)
+                       content_info->media_meta.recorded_date = g_strdup(MEDIA_SVC_TAG_UNKNOWN);
+               content_info->media_meta.datetaken = g_strdup(content_info->media_meta.recorded_date);
 
                mmf_error = mm_file_destroy_tag_attrs(tag);
                if (mmf_error != FILEINFO_ERROR_NONE)