Fix storage_uuid in insert_to_db API 75/89975/1
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 28 Sep 2016 02:29:16 +0000 (11:29 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 28 Sep 2016 02:29:16 +0000 (11:29 +0900)
Change-Id: I79a21b72e62585145c5741e1575bbd2a4f9c1545
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media_info.c

index 2741bab104c6482ed50514d470a06e81a2a2728e..fe2e409b37839e000456178f0bffb74f70cda3a3 100755 (executable)
@@ -466,7 +466,10 @@ int media_info_insert_to_db(const char *path, media_info_h *info)
        media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s));
        media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
 
-       ret = _media_info_get_media_info_from_db(repl_path, DEFAULT_MEDIA_STORAGE_ID, (media_info_h)_media);
+       if (STRING_VALID(storage_id))
+               ret = _media_info_get_media_info_from_db(repl_path, storage_id, (media_info_h)_media);
+       else
+               ret = _media_info_get_media_info_from_db(repl_path, DEFAULT_MEDIA_STORAGE_ID, (media_info_h)_media);
 
        *info = (media_info_h)_media;
        return ret;