summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2018-04-05 02:17:16 (GMT)
committerMinje Ahn <minje.ahn@samsung.com>2018-04-05 02:17:16 (GMT)
commite06ba3fa1d94ca70d374477ad9ace2bcc7c9dc6e (patch)
treedcd53e4afc0a7e9a5bdcdcd4fced7ff75024f0a9 /src
parent12345c8796fe146da2a0c898a8c7de66e15dcdf8 (diff)
downloadlibmedia-thumbnail-e06ba3fa1d94ca70d374477ad9ace2bcc7c9dc6e.zip
libmedia-thumbnail-e06ba3fa1d94ca70d374477ad9ace2bcc7c9dc6e.tar.gz
libmedia-thumbnail-e06ba3fa1d94ca70d374477ad9ace2bcc7c9dc6e.tar.bz2
Change-Id: Iac0c39cd2570c87e6941ff9ccd0647a421f4268c Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/include/util/media-thumb-db.h1
-rwxr-xr-xsrc/media-thumb-internal.c10
-rwxr-xr-xsrc/util/media-thumb-db.c9
3 files changed, 19 insertions, 1 deletions
diff --git a/src/include/util/media-thumb-db.h b/src/include/util/media-thumb-db.h
index 146ebf2..e7768e1 100755
--- a/src/include/util/media-thumb-db.h
+++ b/src/include/util/media-thumb-db.h
@@ -35,6 +35,7 @@
int _media_thumb_get_thumb_from_db(const char *origin_path, char *thumb_path, int max_length, uid_t uid);
int _media_thumb_update_db(const char *origin_path, char *thumb_path, uid_t uid);
+int _media_thumb_get_storage_id_from_db(const char *origin_path, char **storage_id, uid_t uid);
#endif /*_MEDIA_THUMB_DB_H_*/
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index 63aeb11..44b9d88 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -23,6 +23,7 @@
#include "media-thumb-util.h"
#include "media-thumb-internal.h"
#include "media-thumb-ipc.h"
+#include "media-thumb-db.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -331,6 +332,7 @@ int _media_thumb_get_hash_name(const char *file_full_path, char *thumb_hash_path
char *hash_name = NULL;
char file_ext[255] = { 0 };
char *get_path = NULL;
+ char *storage_id = NULL;
int ret_len = 0;
ms_user_storage_type_e storage_type = -1;
int ret = MS_MEDIA_ERR_NONE;
@@ -353,8 +355,14 @@ int _media_thumb_get_hash_name(const char *file_full_path, char *thumb_hash_path
thumb_err("_media_thumb_generate_hash_name fail");
return MS_MEDIA_ERR_INTERNAL;
}
+ ret = _media_thumb_get_storage_id_from_db(file_full_path, &storage_id, uid);
+ if (ret != MS_MEDIA_ERR_NONE) {
+ thumb_err("_media_thumb_get_storage_id_from_db fail");
+ return MS_MEDIA_ERR_INTERNAL;
+ }
- ret = ms_user_get_thumb_store_path(uid, storage_type, &get_path);
+ ret = ms_user_get_thumb_store_path(uid, storage_type, storage_id, &get_path);
+ SAFE_FREE(storage_id);
if (get_path != NULL)
ret_len = snprintf(thumb_hash_path, max_thumb_path - 1, "%s/.%s-%s.jpg", get_path, file_ext, hash_name);
diff --git a/src/util/media-thumb-db.c b/src/util/media-thumb-db.c
index 3431df2..3326fb3 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -144,3 +144,12 @@ int _media_thumb_update_db(const char *origin_path, char *thumb_path, uid_t uid)
return err;
}
+int _media_thumb_get_storage_id_from_db(const char *origin_path, char **storage_id, uid_t uid)
+{
+ int err = MS_MEDIA_ERR_NONE;
+ thumb_retvm_if(!STRING_VALID(origin_path), MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid origin_path");
+
+ err = __media_thumb_get_storage_id(origin_path, uid, storage_id);
+
+ return err;
+} \ No newline at end of file