mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Cleanups:
* Combine early return and assignment lines * use path_basename_nocompression when possible * Move variables to proper scope
This commit is contained in:
parent
f7194e167f
commit
c4fb055fdb
@ -3884,7 +3884,7 @@ bool config_load_override(void *data)
|
|||||||
{
|
{
|
||||||
fill_pathname_parent_dir_name(content_dir_name,
|
fill_pathname_parent_dir_name(content_dir_name,
|
||||||
rarch_path_basename, sizeof(content_dir_name));
|
rarch_path_basename, sizeof(content_dir_name));
|
||||||
game_name = path_basename(rarch_path_basename);
|
game_name = path_basename_nocompression(rarch_path_basename);
|
||||||
|
|
||||||
fill_pathname_join_special_ext(game_path,
|
fill_pathname_join_special_ext(game_path,
|
||||||
config_directory, core_name,
|
config_directory, core_name,
|
||||||
@ -4096,7 +4096,7 @@ bool config_load_remap(const char *directory_input_remapping,
|
|||||||
{
|
{
|
||||||
fill_pathname_parent_dir_name(content_dir_name,
|
fill_pathname_parent_dir_name(content_dir_name,
|
||||||
rarch_path_basename, sizeof(content_dir_name));
|
rarch_path_basename, sizeof(content_dir_name));
|
||||||
game_name = path_basename(rarch_path_basename);
|
game_name = path_basename_nocompression(rarch_path_basename);
|
||||||
|
|
||||||
fill_pathname_join_special_ext(game_path,
|
fill_pathname_join_special_ext(game_path,
|
||||||
directory_input_remapping, core_name,
|
directory_input_remapping, core_name,
|
||||||
@ -5013,7 +5013,7 @@ bool config_save_overrides(enum override_type type, void *data)
|
|||||||
ret = config_file_write(conf, core_path, true);
|
ret = config_file_write(conf, core_path, true);
|
||||||
break;
|
break;
|
||||||
case OVERRIDE_GAME:
|
case OVERRIDE_GAME:
|
||||||
game_name = path_basename(rarch_path_basename);
|
game_name = path_basename_nocompression(rarch_path_basename);
|
||||||
fill_pathname_join_special_ext(game_path,
|
fill_pathname_join_special_ext(game_path,
|
||||||
config_directory, core_name,
|
config_directory, core_name,
|
||||||
game_name,
|
game_name,
|
||||||
|
@ -431,10 +431,10 @@ bool gfx_thumbnail_set_content_image(
|
|||||||
bool gfx_thumbnail_set_content_playlist(
|
bool gfx_thumbnail_set_content_playlist(
|
||||||
gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx)
|
gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx)
|
||||||
{
|
{
|
||||||
const char *content_path = NULL;
|
const char *content_path = NULL;
|
||||||
const char *content_label = NULL;
|
const char *content_label = NULL;
|
||||||
const char *core_name = NULL;
|
const char *core_name = NULL;
|
||||||
const char *db_name = NULL;
|
const char *db_name = NULL;
|
||||||
const struct playlist_entry *entry = NULL;
|
const struct playlist_entry *entry = NULL;
|
||||||
|
|
||||||
if (!path_data)
|
if (!path_data)
|
||||||
@ -442,19 +442,19 @@ bool gfx_thumbnail_set_content_playlist(
|
|||||||
|
|
||||||
/* When content is updated, must regenerate right/left
|
/* When content is updated, must regenerate right/left
|
||||||
* thumbnail paths */
|
* thumbnail paths */
|
||||||
path_data->right_path[0] = '\0';
|
path_data->right_path[0] = '\0';
|
||||||
path_data->left_path[0] = '\0';
|
path_data->left_path[0] = '\0';
|
||||||
|
|
||||||
/* 'Reset' path_data content strings */
|
/* 'Reset' path_data content strings */
|
||||||
path_data->content_path[0] = '\0';
|
path_data->content_path[0] = '\0';
|
||||||
path_data->content_label[0] = '\0';
|
path_data->content_label[0] = '\0';
|
||||||
path_data->content_core_name[0] = '\0';
|
path_data->content_core_name[0] = '\0';
|
||||||
path_data->content_db_name[0] = '\0';
|
path_data->content_db_name[0] = '\0';
|
||||||
path_data->content_img[0] = '\0';
|
path_data->content_img[0] = '\0';
|
||||||
|
|
||||||
/* Must also reset playlist thumbnail display modes */
|
/* Must also reset playlist thumbnail display modes */
|
||||||
path_data->playlist_right_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
path_data->playlist_right_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||||
path_data->playlist_left_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
path_data->playlist_left_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
return false;
|
return false;
|
||||||
@ -494,7 +494,7 @@ bool gfx_thumbnail_set_content_playlist(
|
|||||||
content_label, sizeof(path_data->content_label));
|
content_label, sizeof(path_data->content_label));
|
||||||
else
|
else
|
||||||
fill_pathname(path_data->content_label,
|
fill_pathname(path_data->content_label,
|
||||||
path_basename(content_path),
|
path_basename_nocompression(content_path),
|
||||||
"", sizeof(path_data->content_label));
|
"", sizeof(path_data->content_label));
|
||||||
|
|
||||||
/* Determine content image name */
|
/* Determine content image name */
|
||||||
@ -560,11 +560,9 @@ bool gfx_thumbnail_update_path(
|
|||||||
{
|
{
|
||||||
char content_dir[PATH_MAX_LENGTH];
|
char content_dir[PATH_MAX_LENGTH];
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *type = gfx_thumbnail_get_type(settings,
|
|
||||||
path_data, thumbnail_id);
|
|
||||||
const char *system_name = NULL;
|
const char *system_name = NULL;
|
||||||
char *thumbnail_path = NULL;
|
char *thumbnail_path = NULL;
|
||||||
const char *dir_thumbnails = settings ? settings->paths.directory_thumbnails : NULL;
|
const char *dir_thumbnails = NULL;
|
||||||
|
|
||||||
if (!path_data)
|
if (!path_data)
|
||||||
return false;
|
return false;
|
||||||
@ -584,6 +582,9 @@ bool gfx_thumbnail_update_path(
|
|||||||
|
|
||||||
thumbnail_path[0] = '\0';
|
thumbnail_path[0] = '\0';
|
||||||
content_dir[0] = '\0';
|
content_dir[0] = '\0';
|
||||||
|
|
||||||
|
if (settings)
|
||||||
|
dir_thumbnails = settings->paths.directory_thumbnails;
|
||||||
|
|
||||||
/* Sundry error checking */
|
/* Sundry error checking */
|
||||||
if (string_is_empty(dir_thumbnails))
|
if (string_is_empty(dir_thumbnails))
|
||||||
@ -595,10 +596,10 @@ bool gfx_thumbnail_update_path(
|
|||||||
/* Generate new path */
|
/* Generate new path */
|
||||||
|
|
||||||
/* > Check path_data for empty strings */
|
/* > Check path_data for empty strings */
|
||||||
if (string_is_empty(path_data->content_path) ||
|
if ( string_is_empty(path_data->content_path)
|
||||||
string_is_empty(path_data->content_img) ||
|
|| string_is_empty(path_data->content_img)
|
||||||
(string_is_empty(path_data->system) &&
|
|| ( string_is_empty(path_data->system)
|
||||||
string_is_empty(path_data->content_db_name)))
|
&& string_is_empty(path_data->content_db_name)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* > Get current system */
|
/* > Get current system */
|
||||||
@ -636,6 +637,9 @@ bool gfx_thumbnail_update_path(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char tmp_buf[PATH_MAX_LENGTH];
|
char tmp_buf[PATH_MAX_LENGTH];
|
||||||
|
const char *type = gfx_thumbnail_get_type(settings,
|
||||||
|
path_data, thumbnail_id);
|
||||||
|
|
||||||
tmp_buf[0] = '\0';
|
tmp_buf[0] = '\0';
|
||||||
|
|
||||||
/* > Normal content: assemble path */
|
/* > Normal content: assemble path */
|
||||||
@ -799,9 +803,7 @@ bool gfx_thumbnail_get_content_dir(
|
|||||||
if (!path_data || string_is_empty(path_data->content_path))
|
if (!path_data || string_is_empty(path_data->content_path))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
last_slash = find_last_slash(path_data->content_path);
|
if (!(last_slash = find_last_slash(path_data->content_path)))
|
||||||
|
|
||||||
if (!last_slash)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
path_length = last_slash + 1 - path_data->content_path;
|
path_length = last_slash + 1 - path_data->content_path;
|
||||||
|
@ -3677,7 +3677,7 @@ static int action_ok_remap_file_flush(const char *path,
|
|||||||
success = input_remapping_save_file(path_remapfile);
|
success = input_remapping_save_file(path_remapfile);
|
||||||
|
|
||||||
/* Get remap file name for display purposes */
|
/* Get remap file name for display purposes */
|
||||||
remapfile = path_basename(path_remapfile);
|
remapfile = path_basename_nocompression(path_remapfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_is_empty(remapfile))
|
if (string_is_empty(remapfile))
|
||||||
|
@ -2984,8 +2984,9 @@ static int playlist_qsort_func(const struct playlist_entry *a,
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!string_is_empty(a->path))
|
if (!string_is_empty(a->path))
|
||||||
fill_pathname(a_fallback_label, path_basename(a->path),
|
fill_pathname(a_fallback_label,
|
||||||
"", PATH_MAX_LENGTH * sizeof(char));
|
path_basename_nocompression(a->path),
|
||||||
|
"", PATH_MAX_LENGTH * sizeof(char));
|
||||||
/* If filename is also empty, use core name
|
/* If filename is also empty, use core name
|
||||||
* instead -> this matches the behaviour of
|
* instead -> this matches the behaviour of
|
||||||
* menu_displaylist_parse_playlist() */
|
* menu_displaylist_parse_playlist() */
|
||||||
@ -3008,7 +3009,8 @@ static int playlist_qsort_func(const struct playlist_entry *a,
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!string_is_empty(b->path))
|
if (!string_is_empty(b->path))
|
||||||
fill_pathname(b_fallback_label, path_basename(b->path), "",
|
fill_pathname(b_fallback_label,
|
||||||
|
path_basename_nocompression(b->path), "",
|
||||||
PATH_MAX_LENGTH * sizeof(char));
|
PATH_MAX_LENGTH * sizeof(char));
|
||||||
else if (!string_is_empty(b->core_name))
|
else if (!string_is_empty(b->core_name))
|
||||||
strlcpy(b_fallback_label, b->core_name, PATH_MAX_LENGTH * sizeof(char));
|
strlcpy(b_fallback_label, b->core_name, PATH_MAX_LENGTH * sizeof(char));
|
||||||
|
@ -972,7 +972,8 @@ bool task_push_core_restore(const char *backup_path, const char *dir_libretro,
|
|||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
|
|
||||||
strlcpy(msg, msg_hash_to_str(MSG_CORE_RESTORATION_INVALID_CONTENT), sizeof(msg));
|
strlcpy(msg, msg_hash_to_str(MSG_CORE_RESTORATION_INVALID_CONTENT), sizeof(msg));
|
||||||
strlcat(msg, backup_filename ? backup_filename : "", sizeof(msg));
|
if (backup_filename)
|
||||||
|
strlcat(msg, backup_filename, sizeof(msg));
|
||||||
|
|
||||||
RARCH_ERR("[core restore] Invalid core file selected: %s\n", backup_path);
|
RARCH_ERR("[core restore] Invalid core file selected: %s\n", backup_path);
|
||||||
runloop_msg_queue_push(msg, 1, 100, true,
|
runloop_msg_queue_push(msg, 1, 100, true,
|
||||||
@ -1002,9 +1003,9 @@ bool task_push_core_restore(const char *backup_path, const char *dir_libretro,
|
|||||||
msg[0] = '\0';
|
msg[0] = '\0';
|
||||||
|
|
||||||
strlcpy(msg,
|
strlcpy(msg,
|
||||||
(backup_type == CORE_BACKUP_TYPE_ARCHIVE) ?
|
(backup_type == CORE_BACKUP_TYPE_ARCHIVE)
|
||||||
msg_hash_to_str(MSG_CORE_RESTORATION_DISABLED) :
|
? msg_hash_to_str(MSG_CORE_RESTORATION_DISABLED)
|
||||||
msg_hash_to_str(MSG_CORE_INSTALLATION_DISABLED),
|
: msg_hash_to_str(MSG_CORE_INSTALLATION_DISABLED),
|
||||||
sizeof(msg));
|
sizeof(msg));
|
||||||
strlcat(msg, core_name, sizeof(msg));
|
strlcat(msg, core_name, sizeof(msg));
|
||||||
|
|
||||||
@ -1023,9 +1024,7 @@ bool task_push_core_restore(const char *backup_path, const char *dir_libretro,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Configure handle */
|
/* Configure handle */
|
||||||
backup_handle = (core_backup_handle_t*)calloc(1, sizeof(core_backup_handle_t));
|
if (!(backup_handle = (core_backup_handle_t*)calloc(1, sizeof(core_backup_handle_t))))
|
||||||
|
|
||||||
if (!backup_handle)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
backup_handle->dir_core_assets = NULL;
|
backup_handle->dir_core_assets = NULL;
|
||||||
@ -1050,9 +1049,7 @@ bool task_push_core_restore(const char *backup_path, const char *dir_libretro,
|
|||||||
backup_handle->status = CORE_RESTORE_GET_CORE_CRC;
|
backup_handle->status = CORE_RESTORE_GET_CORE_CRC;
|
||||||
|
|
||||||
/* Create task */
|
/* Create task */
|
||||||
task = task_init();
|
if (!(task = task_init()))
|
||||||
|
|
||||||
if (!task)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Get initial task title */
|
/* Get initial task title */
|
||||||
|
@ -197,9 +197,7 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
if (!task)
|
if (!task)
|
||||||
goto task_finished;
|
goto task_finished;
|
||||||
|
|
||||||
manual_scan = (manual_scan_handle_t*)task->state;
|
if (!(manual_scan = (manual_scan_handle_t*)task->state))
|
||||||
|
|
||||||
if (!manual_scan)
|
|
||||||
goto task_finished;
|
goto task_finished;
|
||||||
|
|
||||||
if (task_get_cancelled(task))
|
if (task_get_cancelled(task))
|
||||||
@ -215,10 +213,9 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
manual_scan->task_config->file_exts, "|");
|
manual_scan->task_config->file_exts, "|");
|
||||||
|
|
||||||
/* Get content list */
|
/* Get content list */
|
||||||
manual_scan->content_list = manual_content_scan_get_content_list(
|
if (!(manual_scan->content_list
|
||||||
manual_scan->task_config);
|
= manual_content_scan_get_content_list(
|
||||||
|
manual_scan->task_config)))
|
||||||
if (!manual_scan->content_list)
|
|
||||||
{
|
{
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
msg_hash_to_str(MSG_MANUAL_CONTENT_SCAN_INVALID_CONTENT),
|
msg_hash_to_str(MSG_MANUAL_CONTENT_SCAN_INVALID_CONTENT),
|
||||||
@ -232,10 +229,9 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
/* Load DAT file, if required */
|
/* Load DAT file, if required */
|
||||||
if (!string_is_empty(manual_scan->task_config->dat_file_path))
|
if (!string_is_empty(manual_scan->task_config->dat_file_path))
|
||||||
{
|
{
|
||||||
manual_scan->dat_file =
|
if (!(manual_scan->dat_file =
|
||||||
logiqx_dat_init(manual_scan->task_config->dat_file_path);
|
logiqx_dat_init(
|
||||||
|
manual_scan->task_config->dat_file_path)))
|
||||||
if (!manual_scan->dat_file)
|
|
||||||
{
|
{
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
msg_hash_to_str(MSG_MANUAL_CONTENT_SCAN_DAT_FILE_LOAD_ERROR),
|
msg_hash_to_str(MSG_MANUAL_CONTENT_SCAN_DAT_FILE_LOAD_ERROR),
|
||||||
@ -246,9 +242,8 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Open playlist */
|
/* Open playlist */
|
||||||
manual_scan->playlist = playlist_init(&manual_scan->playlist_config);
|
if (!(manual_scan->playlist =
|
||||||
|
playlist_init(&manual_scan->playlist_config)))
|
||||||
if (!manual_scan->playlist)
|
|
||||||
goto task_finished;
|
goto task_finished;
|
||||||
|
|
||||||
/* Reset playlist, if required */
|
/* Reset playlist, if required */
|
||||||
@ -256,7 +251,8 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
playlist_clear(manual_scan->playlist);
|
playlist_clear(manual_scan->playlist);
|
||||||
|
|
||||||
/* Get initial playlist size */
|
/* Get initial playlist size */
|
||||||
manual_scan->playlist_size = playlist_size(manual_scan->playlist);
|
manual_scan->playlist_size =
|
||||||
|
playlist_size(manual_scan->playlist);
|
||||||
|
|
||||||
/* Set default core, if required */
|
/* Set default core, if required */
|
||||||
if (manual_scan->task_config->core_set)
|
if (manual_scan->task_config->core_set)
|
||||||
@ -370,8 +366,8 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
|
|
||||||
if (!string_is_empty(content_path))
|
if (!string_is_empty(content_path))
|
||||||
{
|
{
|
||||||
const char *content_file = path_basename(content_path);
|
|
||||||
char task_title[PATH_MAX_LENGTH];
|
char task_title[PATH_MAX_LENGTH];
|
||||||
|
const char *content_file = path_basename(content_path);
|
||||||
|
|
||||||
task_title[0] = '\0';
|
task_title[0] = '\0';
|
||||||
|
|
||||||
@ -386,7 +382,8 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
strlcat(task_title, content_file, sizeof(task_title));
|
strlcat(task_title, content_file, sizeof(task_title));
|
||||||
|
|
||||||
task_set_title(task, strdup(task_title));
|
task_set_title(task, strdup(task_title));
|
||||||
task_set_progress(task, (manual_scan->content_list_index * 100) /
|
task_set_progress(task,
|
||||||
|
(manual_scan->content_list_index * 100) /
|
||||||
manual_scan->content_list_size);
|
manual_scan->content_list_size);
|
||||||
|
|
||||||
/* Add content to playlist */
|
/* Add content to playlist */
|
||||||
@ -429,9 +426,9 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
|
|
||||||
if (!string_is_empty(m3u_path))
|
if (!string_is_empty(m3u_path))
|
||||||
{
|
{
|
||||||
const char *m3u_name = path_basename(m3u_path);
|
|
||||||
m3u_file_t *m3u_file = NULL;
|
|
||||||
char task_title[PATH_MAX_LENGTH];
|
char task_title[PATH_MAX_LENGTH];
|
||||||
|
const char *m3u_name = path_basename_nocompression(m3u_path);
|
||||||
|
m3u_file_t *m3u_file = NULL;
|
||||||
|
|
||||||
task_title[0] = '\0';
|
task_title[0] = '\0';
|
||||||
|
|
||||||
@ -450,9 +447,7 @@ static void task_manual_content_scan_handler(retro_task_t *task)
|
|||||||
manual_scan->m3u_list->size);
|
manual_scan->m3u_list->size);
|
||||||
|
|
||||||
/* Load M3U file */
|
/* Load M3U file */
|
||||||
m3u_file = m3u_file_init(m3u_path);
|
if ((m3u_file = m3u_file_init(m3u_path)))
|
||||||
|
|
||||||
if (m3u_file)
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -523,14 +518,10 @@ static bool task_manual_content_scan_finder(retro_task_t *task, void *user_data)
|
|||||||
|
|
||||||
if (!task || !user_data)
|
if (!task || !user_data)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (task->handler != task_manual_content_scan_handler)
|
if (task->handler != task_manual_content_scan_handler)
|
||||||
return false;
|
return false;
|
||||||
|
if (!(manual_scan = (manual_scan_handle_t*)task->state))
|
||||||
manual_scan = (manual_scan_handle_t*)task->state;
|
|
||||||
if (!manual_scan)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return string_is_equal(
|
return string_is_equal(
|
||||||
(const char*)user_data, manual_scan->playlist_config.path);
|
(const char*)user_data, manual_scan->playlist_config.path);
|
||||||
}
|
}
|
||||||
@ -542,16 +533,18 @@ bool task_push_manual_content_scan(
|
|||||||
task_finder_data_t find_data;
|
task_finder_data_t find_data;
|
||||||
char task_title[PATH_MAX_LENGTH];
|
char task_title[PATH_MAX_LENGTH];
|
||||||
retro_task_t *task = NULL;
|
retro_task_t *task = NULL;
|
||||||
manual_scan_handle_t *manual_scan = (manual_scan_handle_t*)
|
manual_scan_handle_t *manual_scan = NULL;
|
||||||
calloc(1, sizeof(manual_scan_handle_t));
|
|
||||||
|
|
||||||
task_title[0] = '\0';
|
task_title[0] = '\0';
|
||||||
|
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
if (!playlist_config ||
|
if ( !playlist_config
|
||||||
string_is_empty(playlist_directory) ||
|
|| string_is_empty(playlist_directory))
|
||||||
!manual_scan)
|
return false;
|
||||||
goto error;
|
|
||||||
|
if (!(manual_scan = (manual_scan_handle_t*)
|
||||||
|
calloc(1, sizeof(manual_scan_handle_t))))
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Configure handle */
|
/* Configure handle */
|
||||||
manual_scan->task_config = NULL;
|
manual_scan->task_config = NULL;
|
||||||
@ -563,21 +556,19 @@ bool task_push_manual_content_scan(
|
|||||||
manual_scan->playlist_index = 0;
|
manual_scan->playlist_index = 0;
|
||||||
manual_scan->content_list_size = 0;
|
manual_scan->content_list_size = 0;
|
||||||
manual_scan->content_list_index = 0;
|
manual_scan->content_list_index = 0;
|
||||||
manual_scan->m3u_list = string_list_new();
|
|
||||||
manual_scan->m3u_index = 0;
|
|
||||||
manual_scan->status = MANUAL_SCAN_BEGIN;
|
manual_scan->status = MANUAL_SCAN_BEGIN;
|
||||||
|
manual_scan->m3u_index = 0;
|
||||||
|
manual_scan->m3u_list = string_list_new();
|
||||||
|
|
||||||
if (!manual_scan->m3u_list)
|
if (!manual_scan->m3u_list)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* > Get current manual content scan configuration */
|
/* > Get current manual content scan configuration */
|
||||||
manual_scan->task_config = (manual_content_scan_task_config_t*)
|
if (!(manual_scan->task_config = (manual_content_scan_task_config_t*)
|
||||||
calloc(1, sizeof(manual_content_scan_task_config_t));
|
calloc(1, sizeof(manual_content_scan_task_config_t))))
|
||||||
|
|
||||||
if (!manual_scan->task_config)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!manual_content_scan_get_task_config(
|
if ( !manual_content_scan_get_task_config(
|
||||||
manual_scan->task_config, playlist_directory))
|
manual_scan->task_config, playlist_directory))
|
||||||
{
|
{
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
@ -605,9 +596,7 @@ bool task_push_manual_content_scan(
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Create task */
|
/* Create task */
|
||||||
task = task_init();
|
if (!(task = task_init()))
|
||||||
|
|
||||||
if (!task)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* > Get task title */
|
/* > Get task title */
|
||||||
@ -632,14 +621,6 @@ bool task_push_manual_content_scan(
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
||||||
/* Clean up task */
|
|
||||||
if (task)
|
|
||||||
{
|
|
||||||
free(task);
|
|
||||||
task = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clean up handle */
|
/* Clean up handle */
|
||||||
free_manual_content_scan_handle(manual_scan);
|
free_manual_content_scan_handle(manual_scan);
|
||||||
manual_scan = NULL;
|
manual_scan = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user