2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "ivug-common.h"
20 #include "ivug-debug.h"
21 #include "ivug-parameter.h"
22 #include "ivug-file-info.h"
25 #include "ivug-util.h"
27 #include "ivug-filter.h"
30 #define IVUG_BUNDLE_KEY_VIEW_MODE "View Mode"
31 #define IVUG_BUNDLE_KEY_PATH "Path"
32 #define IVUG_BUNDLE_KEY_THUMBNAIL_PATH "Thumb Path"
33 #define IVUG_BUNDLE_KEY_ALBUM_IDX "Album index"
34 #define IVUG_BUNDLE_KEY_VIEW_BY "View By"
35 #define IVUG_BUNDLE_KEY_INDEX "Index"
36 #define IVUG_BUNDLE_KEY_SORT_BY "Sort By"
37 #define IVUG_BUNDLE_KEY_FOOTSTEPS "Footsteps"
39 #define IVUG_BUNDLE_KEY_MAX_LONGITUDE "LON_MAX"
40 #define IVUG_BUNDLE_KEY_MIN_LONGITUDE "LON_MIN"
41 #define IVUG_BUNDLE_KEY_MAX_LATITUDE "LAT_MAX"
42 #define IVUG_BUNDLE_KEY_MIN_LATITUDE "LAT_MIN"
44 #define IVUG_BUNDLE_KEY_SETAS_TYPE "Setas type"
45 #define IVUG_BUNDLE_KEY_TAG_NAME "Tag name"
47 #define IVUG_BUNDLE_KEY_RESOLUTION "Resolution"
48 #define IVUG_BUNDLE_KEY_FIXED_RATIO "Fixed ratio"
50 #define IVUG_BUNDLE_KEY_CROP_MODE "http://tizen.org/appcontrol/data/image/crop_mode"
51 #define IVUG_BUNDLE_VALUE_CROP_MODE_AUTO "auto"
52 #define IVUG_BUNDLE_VALUE_CROP_MODE_FIT_TO_SCREEN "fit_to_screen"
54 #define IVUG_BUNDLE_KEY_MEDIA_TYPE "Media type"
56 #define IVUG_BUNDLE_KEY_STANDALONE "Standalone"
58 #define IVUG_BUNDLE_KEY_CONTACT_ID "Contact id"
59 #define IVUG_BUNDLE_KEY_CLUSTER_ID "Cluster id"
60 #define IVUG_BUNDLE_KEY_GROUP_ID "Group id"
62 #define IVUG_BUNDLE_KEY_SELECTED_INDEX "Selected index"
65 #define IVUG_DEFAULT_MODE IVUG_MODE_SINGLE
66 #define IVUG_DEFAULT_INDEX (1) // First item
68 #define IVUG_FILE_PREFIX "file://"
71 void _ivug_free(char **val)
78 _get_view_mode(ivug_parameter* data, const char* val)
80 IV_ASSERT(val != NULL);
82 #define IVUG_BUNDLE_VALUE_VIEW_MODE_ALBUM "ALBUM"
83 #define IVUG_BUNDLE_VALUE_VIEW_MODE_NORMAL "NORMAL"
84 #define IVUG_BUNDLE_VALUE_VIEW_MODE_SINGLE "SINGLE"
85 #define IVUG_BUNDLE_VALUE_VIEW_MODE_GALLERY "GALLERY"
86 #define IVUG_BUNDLE_VALUE_VIEW_MODE_CAMERA "CAMERA"
87 #define IVUG_BUNDLE_VALUE_VIEW_MODE_DISPLAY "DISPLAY"
88 #define IVUG_BUNDLE_VALUE_VIEW_MODE_SETAS "SETAS"
89 #define IVUG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW "SLIDESHOW"
91 int len = strlen(val);
93 if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_NORMAL, len) == 0
94 || strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_GALLERY, len) == 0 )
96 return IVUG_MODE_NORMAL;
98 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_ALBUM, len) == 0)
101 MSG_IVUG_ERROR("ALBUM is deprecated!!!! plz check");
102 printf("bundle key ALBUM is deprecated!!!! plz check\n");
103 return IVUG_MODE_NORMAL;
105 else if ( strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_CAMERA, len) == 0)
107 data->start_index = 1; //apply window loading
108 data->view_by = IVUG_VIEW_BY_FOLDER; // In camera case, All images should be shown in camera folder.
109 return IVUG_MODE_CAMERA;
111 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SINGLE, len) == 0)
113 if(data->view_by != IVUG_VIEW_BY_FOLDER)
114 data->view_by = IVUG_VIEW_BY_FILE;
115 return IVUG_MODE_SINGLE;
117 else if ( strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_DISPLAY, len) == 0)
119 data->view_by = IVUG_VIEW_BY_FILE;
120 return IVUG_MODE_DISPLAY;
122 else if(strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SETAS, len) == 0)
124 data->view_by = IVUG_VIEW_BY_FILE;
125 return IVUG_MODE_SETAS;
127 else if(strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW, len) == 0)
129 if(data->view_by == IVUG_VIEW_BY_INVAILD)
131 data->view_by = IVUG_VIEW_BY_FOLDER;
133 return IVUG_MODE_SLIDESHOW;
136 MSG_IVUG_ERROR("Invalid mode : %s", val);
137 return IVUG_MODE_INVAILD;
142 _get_view_by(const char* val)
145 #define IVUG_BUNDLE_VALUE_VIEW_BY_ALL "All"
146 #define IVUG_BUNDLE_VALUE_VIEW_BY_FAVORITES "Favorites"
147 #define IVUG_BUNDLE_VALUE_VIEW_BY_TAGS "Tags"
148 #define IVUG_BUNDLE_VALUE_VIEW_BY_FLODER "By Folder"
149 #define IVUG_BUNDLE_VALUE_VIEW_BY_PLACES "Places"
151 IV_ASSERT(val != NULL);
153 int len = strlen(val);
155 if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_FLODER, len) == 0 )
157 return IVUG_VIEW_BY_FOLDER;
159 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_ALL, len) == 0 )
161 return IVUG_VIEW_BY_ALL;
163 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_FAVORITES, len) == 0)
165 return IVUG_VIEW_BY_FAVORITES;
167 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_TAGS, len) == 0)
169 return IVUG_VIEW_BY_TAG;
171 else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_PLACES, len) == 0)
173 return IVUG_VIEW_BY_PLACES;
176 MSG_IVUG_ERROR("Invalid view by : %s", val);
178 return IVUG_VIEW_BY_FILE;
183 static ivug_setas_type
184 _get_setas_type(const char* val)
186 IV_ASSERT(val != NULL);
188 #define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER "Wallpaper"
189 #define IVUG_BUNDLE_VALUE_SETAS_UG_LOCKSCREEN "Lockscreen"
190 #define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_N_LOCKSCREEN "Wallpaper & Lockscreen"
191 #define IVUG_BUNDLE_VALUE_SETAS_UG_CALLERID "CallerID"
192 #define IVUG_BUNDLE_VALUE_SETAS_UG_VIDEO_CALLEID "VideoCallID"
193 #define IVUG_BUNDLE_VALUE_SETAS_UG_CROP "Crop"
194 #define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_CROP "Wallpaper Crop"
196 int len = strlen(val);
198 if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER, len) == 0 )
200 return IVUG_SET_AS_UG_TYPE_WALLPAPER;
202 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_CROP, len) == 0 )
204 return IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP;
206 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_LOCKSCREEN, len) == 0 )
208 return IVUG_SET_AS_UG_TYPE_LOCKSCREEN;
210 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_N_LOCKSCREEN, len) == 0 )
212 return IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN;
214 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_CALLERID, len) == 0)
216 return IVUG_SET_AS_UG_TYPE_CALLER_ID;
218 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_VIDEO_CALLEID, len) == 0)
220 return IVUG_SET_AS_UG_TYPE_VIDEO_CALL_ID;
222 else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_CROP, len) == 0)
224 return IVUG_SET_AS_UG_TYPE_CROP;
227 MSG_IVUG_ERROR("Invalid setas ug type : %s", val);
228 return IVUG_SET_AS_UG_TYPE_INVALID;
231 static ivug_media_type
232 _get_media_type(const char* val)
234 IV_ASSERT(val != NULL);
235 #define IVUG_BUNDLE_VALUE_MEDIA_TYPE_ALL "All"
236 #define IVUG_BUNDLE_VALUE_MEDIA_TYPE_IMAGE "Image"
237 #define IVUG_BUNDLE_VALUE_MEDIA_TYPE_VIDEO "Video"
239 int len = strlen(val);
241 if (strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_IMAGE, len) == 0 )
243 return IVUG_MEDIA_TYPE_IMAGE;
245 else if (strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_VIDEO, len) == 0)
247 return IVUG_MEDIA_TYPE_VIDEO;
249 else if(strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_ALL, len) == 0)
251 return IVUG_MEDIA_TYPE_ALL;
254 MSG_IVUG_ERROR("Invalid media type : %s", val);
255 return IVUG_MEDIA_TYPE_MAX;
258 static bool _data_print(service_h service, const char *key, void *user_data)
267 service_is_extra_data_array(service, key, &array);
270 service_get_extra_data(service, key, &value);
271 MSG_IVUG_HIGH(" %s : %s", key, value);
276 service_get_extra_data_array(service, key, &value_array, &array_len);
277 MSG_IVUG_HIGH(" %s :", key);
278 for(i=0; i<array_len; i++)
280 MSG_IVUG_HIGH(" %s", value_array[i]);
282 for(i=0; i<array_len; i++)
284 free(value_array[i]);
292 static void _print_service_data(service_h service)
294 int ret = service_foreach_extra_data(service, _data_print, NULL);
296 if(SERVICE_ERROR_NONE != ret)
298 MSG_IVUG_ERROR("service_foreach_extra_data ERROR");
306 ivug_param_create_from_bundle(service_h service)
310 MSG_IVUG_WARN("bundle value is NULL");
314 //print key and value.
315 MSG_IVUG_HIGH("**********************************");
316 _print_service_data(service);
317 MSG_IVUG_HIGH("**********************************");
320 ivug_parameter* data = (ivug_parameter*)calloc(1, sizeof(ivug_parameter));
324 MSG_IMAGEVIEW_FATAL("Cannot allocate memory");
329 char* standalone = NULL;
331 service_get_extra_data (service, IVUG_BUNDLE_KEY_STANDALONE, &standalone);
332 if (standalone != NULL)
334 data->bStandalone = true;
335 _ivug_free(&standalone);
339 data->bStandalone = false;
343 char* szFilePath = NULL;
345 service_get_extra_data (service, IVUG_BUNDLE_KEY_PATH, &szFilePath);
346 if(szFilePath == NULL)
348 MSG_IVUG_ERROR("File path is NULL");
349 service_get_uri(service, &szFilePath); // app gadget
352 MSG_IMAGEVIEW_ERROR("App gadget launched %s", szFilePath);
353 service_add_extra_data (service, "View Mode", "SINGLE");
356 if ( szFilePath != NULL )
358 if(strncmp(IVUG_FILE_PREFIX, szFilePath, strlen(IVUG_FILE_PREFIX)) == 0)
360 data->filepath = strdup(szFilePath + strlen(IVUG_FILE_PREFIX));
364 data->filepath = strdup(szFilePath);
366 MSG_IVUG_MED("Current File = %s", data->filepath);
367 _ivug_free(&szFilePath);
371 ivug_param_delete(data);
377 char* szViewBy = NULL;
379 service_get_extra_data (service, IVUG_BUNDLE_KEY_VIEW_BY, &szViewBy);
380 if (szViewBy != NULL)
382 MSG_IVUG_MED("View By = %s", szViewBy);
384 data->view_by = _get_view_by(szViewBy);
386 if (data->view_by == IVUG_VIEW_BY_TAG)
388 char* szTagName = NULL;
390 service_get_extra_data (service, IVUG_BUNDLE_KEY_TAG_NAME, &szTagName);
391 if ( szTagName != NULL )
393 tag_handle t_handle = ivug_db_get_tag_handle(szTagName);
396 MSG_IVUG_FATAL("View by Tag. but tag handle is NULL" );
397 ivug_param_delete(data);
401 data->tag_id = ivug_db_get_tag_id(t_handle);
403 ivug_db_destroy_tag(t_handle);
405 MSG_IVUG_HIGH("Tag name=%s", szTagName);
406 MSG_IVUG_HIGH("Tag id=%d", data->tag_id);
407 _ivug_free(&szTagName);
411 MSG_IVUG_FATAL("View by Tag. but Tagname is NULL" );
413 _ivug_free(&szViewBy);
414 ivug_param_delete(data);
418 _ivug_free(&szViewBy);
422 MSG_IVUG_ERROR("View By is NULL");
423 data->view_by = IVUG_VIEW_BY_INVAILD;
426 media_handle file_handle = ivug_db_get_file_handle(data->filepath);
427 if(file_handle == NULL)
429 MSG_IVUG_ERROR("Current File = %s is not in DB", data->filepath);
430 data->view_by = IVUG_VIEW_BY_FILE;
433 //parse image index at album
436 service_get_extra_data (service, IVUG_BUNDLE_KEY_INDEX, &val);
439 data->start_index = ivug_atoi(val);
440 MSG_IVUG_MED("Slide Index = %d", data->start_index);
445 if(data->view_by == IVUG_VIEW_BY_FOLDER)
447 MSG_IVUG_WARN("IVUG_VIEW_BY_FOLDER but index was not set");
448 data->start_index = IVUG_INVALID_INDEX;
452 data->start_index = IVUG_DEFAULT_INDEX;
454 MSG_IVUG_WARN("Slide Index is not set. Set as default : %d", data->start_index);
460 service_get_extra_data (service, IVUG_BUNDLE_KEY_VIEW_MODE, &szMode);
463 data->mode = _get_view_mode(data, szMode);
464 MSG_IVUG_MED("View mode is %s(%d)", szMode, data->mode);
469 data->mode = IVUG_DEFAULT_MODE;
470 MSG_IVUG_HIGH("View mode is NULL. Set Default(%d)", data->mode);
473 //parse album id -album id is cluster id of media service
474 service_get_extra_data (service, IVUG_BUNDLE_KEY_ALBUM_IDX, &val);
475 if(val && data->view_by != IVUG_VIEW_BY_ALL)
477 data->album_id = uuid_getuuid(val);
478 MSG_IVUG_MED("album_uuid is %s", uuid_getchar(data->album_id));
482 data->album_id = INVALID_UUID;
483 MSG_IVUG_WARN("Album index is NULL");
488 if (data->view_by == IVUG_VIEW_BY_FOLDER && data->album_id == INVALID_UUID)
492 **********************************
495 Path:/opt/usr/media/Camera shots/IMAGE0021.jpg
496 **********************************
498 // Get album id from file path.
499 char *dir = ivug_get_directory(data->filepath);
500 media_handle m_handle = ivug_db_get_folder_handle(dir);
503 if(data->album_id == INVALID_UUID)
507 MSG_IVUG_ERROR("View by Folder. but media handle is NULL" );
508 //ivug_param_delete(data);
510 data->view_by = IVUG_VIEW_BY_DIRECTORY; // check manually
514 data->album_id = ivug_db_get_folder_id(m_handle);
516 ivug_db_destroy_folder_handle(m_handle);
518 MSG_IVUG_HIGH("Get Album ID(%s) from file %s", uuid_getchar(data->album_id), data->filepath);
523 service_get_extra_data (service, IVUG_BUNDLE_KEY_MEDIA_TYPE, &val);
526 data->media_type = _get_media_type(val);
527 MSG_IVUG_MED("Media Type=%s(%d)", val, data->media_type);
532 MSG_IVUG_WARN("Media type is not specified.");
538 service_get_extra_data (service, IVUG_BUNDLE_KEY_MAX_LONGITUDE, &val);
541 eina_convert_atod(val, strlen(val), &m, &e);
542 data->max_longitude = ldexp((double)m, e);
543 MSG_IVUG_MED("Max Longitude =%f", data->max_longitude);
548 MSG_IVUG_MED("Max Longitude is not specified.");
551 service_get_extra_data (service, IVUG_BUNDLE_KEY_MIN_LONGITUDE, &val);
554 eina_convert_atod(val, strlen(val), &m, &e);
555 data->min_longitude = ldexp((double)m, e);
556 MSG_IVUG_MED("Min Longitude =%f", data->min_longitude);
561 MSG_IVUG_MED("Min Longitude is not specified.");
564 service_get_extra_data (service, IVUG_BUNDLE_KEY_MAX_LATITUDE, &val);
567 eina_convert_atod(val, strlen(val), &m, &e);
568 data->max_latitude = ldexp((double)m, e);
569 MSG_IVUG_MED("Max Latitude =%f", data->max_latitude);
574 MSG_IVUG_MED("Max Latitude is not specified.");
577 service_get_extra_data (service, IVUG_BUNDLE_KEY_MIN_LATITUDE, &val);
580 eina_convert_atod(val, strlen(val), &m, &e);
581 data->min_latitude = ldexp((double)m, e);
582 MSG_IVUG_MED("Min Latitude =%f", data->min_latitude);
587 MSG_IVUG_MED("Min Latitude is not specified.");
590 service_get_extra_data (service, IVUG_BUNDLE_KEY_SETAS_TYPE, &val);
593 MSG_IVUG_MED("SetAs UG Type=%s", val);
594 data->setas_type = _get_setas_type(val);
596 char* resolution = NULL;
598 service_get_extra_data (service, IVUG_BUNDLE_KEY_RESOLUTION, &resolution);
601 sscanf(resolution, "%5dx%5d", &(data->width), &(data->height));
602 MSG_IVUG_MED("Rectangle width = %d, height = %d", data->width, data->height);
603 if(data->width == 0 || data->height == 0)
605 MSG_IVUG_ERROR("Resolution is invalid");
606 _ivug_free(&resolution);
608 ivug_param_delete(data);
616 MSG_IVUG_HIGH("Rectangle ratio is not set. Set as default : %dx%d", data->width, data->height);
619 data->bRatioFix = false;
620 char* bRatioFix = NULL;
622 service_get_extra_data (service, IVUG_BUNDLE_KEY_FIXED_RATIO, &bRatioFix);
625 MSG_IVUG_MED("Fixed ratio=%s", bRatioFix);
626 if(strcmp(bRatioFix, "TRUE") == 0)
628 data->bRatioFix = true;
630 _ivug_free(&bRatioFix);
633 char* crop_mode = NULL;
634 service_get_extra_data (service, IVUG_BUNDLE_KEY_CROP_MODE, &crop_mode);
637 MSG_IVUG_MED("Crop mode=%s", crop_mode);
638 if(strcmp(crop_mode, IVUG_BUNDLE_VALUE_CROP_MODE_FIT_TO_SCREEN) == 0)
645 evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h);
646 rot = gGetRotationDegree();
647 if(rot == 90 || rot == 270)
654 data->height = lcd_h;
655 data->bRatioFix = true;
657 _ivug_free(&crop_mode);
663 data->footsteps = false; /* default */
664 service_get_extra_data (service, IVUG_BUNDLE_KEY_FOOTSTEPS, &val);
667 MSG_IVUG_MED("Footsteps=%s", val);
668 if(strcmp(val, "TRUE") == 0)
670 data->footsteps = true;
678 char **index_list = NULL;
680 service_get_extra_data_array(service, IVUG_BUNDLE_KEY_SELECTED_INDEX, &index_list, &index_len);
681 if(index_list != NULL)
684 for(i=0; i<index_len; i++)
686 data->selected_list = eina_list_append(data->selected_list, (void *)ivug_atoi(index_list[i]));
688 for(i=0; i<index_len; i++)
699 ivug_param_delete(ivug_parameter* data)
701 IV_ASSERT(data != NULL);
704 free(data->filepath);
705 data->filepath = NULL;
709 uuid_free(data->album_id);
713 MSG_IVUG_HIGH("Parameter is freed.");
721 Filter_struct *ivug_param_create_filter(const ivug_parameter *param)
723 IV_ASSERT(param != NULL);
725 Filter_struct *filter_str = (Filter_struct *)calloc(1, sizeof(Filter_struct));
726 IV_ASSERT(filter_str != NULL);
728 media_handle handle = NULL;
731 if ( param->view_by == IVUG_VIEW_BY_DIRECTORY )
733 filter_str->type = FILTER_DIRECTORY;
734 filter_str->view_by = param->view_by;
736 Direcotry_Filter *filter = (Direcotry_Filter *)calloc(1, sizeof(Direcotry_Filter) );
738 IV_ASSERT(filter != NULL);
740 filter_str->dir_filter = filter;
741 filter_str->dir_filter->basedir = ivug_get_directory(param->filepath);
742 filter_str->dir_filter->current = strdup( param->filepath );
748 filter_str->type = FILTER_DB;
751 filter_str->view_by = param->view_by;
752 filter_str->media_type = param->media_type;
753 filter_str->sort_type = param->sort_type;
754 filter_str->index = param->start_index;
755 filter_str->selected_list = param->selected_list;
758 filter_str->filepath = strdup(param->filepath);
761 if(filter_str->type == FILTER_DB)
763 DB_Filter *filter = calloc(1, sizeof(DB_Filter));
765 IV_ASSERT(filter != NULL);
767 MSG_SDATA_HIGH("param->view_by is %d", param->view_by);
768 switch(filter_str->view_by)
770 case IVUG_VIEW_BY_PLACES:
771 filter->place.max_longitude = param->max_longitude;
772 filter->place.min_longitude = param->min_longitude;
773 filter->place.max_latitude = param->max_latitude;
774 filter->place.min_latitude = param->min_latitude;
777 case IVUG_VIEW_BY_TAG:
778 filter->tag_id = param->tag_id;
781 case IVUG_VIEW_BY_FAVORITES:
782 filter->album_id = INVALID_UUID;
784 case IVUG_VIEW_BY_FILE:
785 filter->file_path = strdup(param->filepath);
787 case IVUG_VIEW_BY_ALL:
788 filter->album_id = uuid_assign(param->album_id);
790 case IVUG_VIEW_BY_FOLDER:
791 if(param->album_id == NULL)
793 dir = ivug_get_directory(param->filepath);
794 handle = ivug_db_get_folder_handle(dir);
795 filter->album_id = ivug_db_get_folder_id(handle);
800 filter->album_id = uuid_assign(param->album_id);
803 case IVUG_VIEW_BY_DIRECTORY:
805 case IVUG_VIEW_BY_INVAILD:
807 MSG_SDATA_WARN("Invalid ViewBy : %d", param->view_by);
812 filter_str->db_filter = filter;