return 0;
}
-int dir_scan_non_recursive(const char *path)
+int dir_scan(const char *path, bool is_recursive)
{
int ret = 0;
char storage_id[36+1] = {0,};
if (ret < 0)
return -1;
- return media_directory_scanning_async(path, storage_id, FALSE, callback, NULL, tzplatform_getuid(TZ_USER_NAME));
-}
-
-int dir_scan_recursive(char *path)
-{
- int ret = 0;
- char storage_id[36+1] = {0,};
-
- ret = __get_storage_id(path, storage_id, tzplatform_getuid(TZ_USER_NAME));
- if (ret < 0)
- return -1;
-
- return media_directory_scanning_async(path, storage_id, TRUE, callback, NULL, tzplatform_getuid(TZ_USER_NAME));
+ return media_directory_scanning_async(path, storage_id, is_recursive, callback, NULL, tzplatform_getuid(TZ_USER_NAME));
}
int main(int argc, char **argv)
else
strncpy(req_path, argv1, len);
}
- ret = dir_scan_non_recursive(req_path);
+ ret = dir_scan(req_path, FALSE);
if (ret != 0) {
printf("error : %d\n", ret);
exit(0);
strncpy(req_path, argv2, len);
}
- ret = dir_scan_recursive(req_path);
+ ret = dir_scan(req_path, TRUE);
if (ret != 0) {
printf("error : %d\n", ret);
exit(0);
exit(0);
}
} else {
- printf("[%d] invalide option\n", __LINE__);
+ printf("[%d] invalid option\n", __LINE__);
print_help();
exit(0);
}