{
int ret = MS_MEDIA_ERR_NONE;
uid_t uid = MEDIA_DEFAULT_UID;
-
/* update storage information into media DB */
int validity = 0;
ms_dir_scan_type_t scan_type = MS_SCAN_ALL;
char *storage_path = NULL;
- const char* storage_id = g_strdup("familytv");
- const char* path = MEDIA_ROOT_PATH_SENIOR_MODE;
ms_sys_get_uid(&uid);
- ret = ms_check_storage(handle, storage_id, &storage_path, &validity, uid);
+ ret = ms_check_storage(handle, SENIOR_MODE_ID, &storage_path, &validity, uid);
if (ret == 0) {
if (storage_path != NULL) {
- MS_DBG_SWARN("##[senior mode]####[path [%s], %s]###", path, storage_path);
- if (strcmp(path, storage_path)) {
+ MS_DBG_SWARN("##[senior mode]####[path [%s], %s]###", MEDIA_ROOT_PATH_SENIOR_MODE, storage_path);
+ if (strcmp(MEDIA_ROOT_PATH_SENIOR_MODE, storage_path)) {
/* update storage path */
- MS_DBG_SWARN("##[senior mode]update storage from %s to %s", storage_path, path);
- ret = ms_update_storage(handle, storage_id, path, uid);
+ MS_DBG_SWARN("##[senior mode]update storage from %s to %s", storage_path, MEDIA_ROOT_PATH_SENIOR_MODE);
+ ret = ms_update_storage(handle, SENIOR_MODE_ID, MEDIA_ROOT_PATH_SENIOR_MODE, uid);
}
if (validity == 0) {
- ms_set_storage_validity(handle, storage_id, 1, uid);
+ ms_set_storage_validity(handle, SENIOR_MODE_ID, 1, uid);
/* update storage_id table set validity=0 first */
- ms_validity_change_all_items(handle, storage_id, false, uid);
- ms_set_folder_validity(handle, storage_id, storage_path, MS_INVALID, true, uid);
+ ms_validity_change_all_items(handle, SENIOR_MODE_ID, false, uid);
+ ms_set_folder_validity(handle, SENIOR_MODE_ID, storage_path, MS_INVALID, true, uid);
/* update folder table set scan_status=0 first */
- ms_set_folder_scan_status(handle, storage_id, NULL, MS_DIR_SCAN_NONE, uid);
+ ms_set_folder_scan_status(handle, SENIOR_MODE_ID, NULL, MS_DIR_SCAN_NONE, uid);
}
scan_type = MS_SCAN_PART;
g_free(storage_path);
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_SWARN("##[senior mode]insert storage %s", path);
- ret = ms_insert_storage(handle, storage_id, path, uid);
+ MS_DBG_SWARN("##[senior mode]insert storage %s", MEDIA_ROOT_PATH_SENIOR_MODE);
+ ret = ms_insert_storage(handle, SENIOR_MODE_ID, MEDIA_ROOT_PATH_SENIOR_MODE, uid);
MS_DBG_WARN("##[senior mode]");
scan_type = MS_SCAN_ALL;
}
} else {
/* there is no information of this storage in Media DB */
- MS_DBG_SWARN("##[senior mode]insert storage %s", path);
- ret = ms_insert_storage(handle, storage_id, path, uid);
+ MS_DBG_SWARN("##[senior mode]insert storage %s", MEDIA_ROOT_PATH_SENIOR_MODE);
+ ret = ms_insert_storage(handle, SENIOR_MODE_ID, MEDIA_ROOT_PATH_SENIOR_MODE, uid);
MS_DBG_WARN("##[senior mode]");
scan_type = MS_SCAN_ALL;
}
/* request to update media db */
- ret = ms_insert_folder(handle, storage_id, path, uid);
+ ret = ms_insert_folder(handle, SENIOR_MODE_ID, MEDIA_ROOT_PATH_SENIOR_MODE, uid);
if (ret != MS_MEDIA_ERR_NONE)
MS_DBG_ERR("##[senior mode]error : ms_insert_folder failed");
- ms_send_storage_otg_scan_request(path, storage_id, scan_type, uid);
- g_free(storage_id);
+ ms_send_storage_otg_scan_request(MEDIA_ROOT_PATH_SENIOR_MODE, SENIOR_MODE_ID, scan_type, uid);
return ret;
}