mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
(Thumbnails Updater) Added Thumbnails Updater
This commit is contained in:
parent
a34ce90940
commit
dcd5391a75
@ -298,6 +298,11 @@ static int deferred_push_disk_options(menu_displaylist_info_t *info)
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static int deferred_push_thumbnails_updater_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
return deferred_push_dlist(info, DISPLAYLIST_THUMBNAILS_UPDATER);
|
||||
}
|
||||
|
||||
static int deferred_push_core_updater_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
return deferred_push_dlist(info, DISPLAYLIST_CORES_UPDATER);
|
||||
@ -620,6 +625,11 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
|
||||
case MENU_LABEL_DEFERRED_CORE_UPDATER_LIST:
|
||||
#ifdef HAVE_NETWORKING
|
||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_updater_list);
|
||||
#endif
|
||||
break;
|
||||
case MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
||||
#ifdef HAVE_NETWORKING
|
||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_thumbnails_updater_list);
|
||||
#endif
|
||||
break;
|
||||
case MENU_LABEL_DEFERRED_LAKKA_LIST:
|
||||
|
@ -364,6 +364,13 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||
info_label = menu_hash_to_str(
|
||||
MENU_LABEL_DEFERRED_CORE_UPDATER_LIST);
|
||||
break;
|
||||
case ACTION_OK_DL_THUMBNAILS_UPDATER_LIST:
|
||||
info.type = type;
|
||||
info.directory_ptr = idx;
|
||||
info_path = path;
|
||||
info_label = menu_hash_to_str(
|
||||
MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST);
|
||||
break;
|
||||
case ACTION_OK_DL_CORE_CONTENT_LIST:
|
||||
info.type = type;
|
||||
info.directory_ptr = idx;
|
||||
@ -1252,10 +1259,15 @@ static void cb_decompressed(void *task_data, void *user_data, const char *err)
|
||||
|
||||
if (dec && !err)
|
||||
{
|
||||
if (type_hash == CB_CORE_UPDATER_DOWNLOAD)
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
|
||||
else if (type_hash == CB_UPDATE_ASSETS)
|
||||
event_cmd_ctl(EVENT_CMD_REINIT, NULL);
|
||||
switch (type_hash)
|
||||
{
|
||||
case CB_CORE_UPDATER_DOWNLOAD:
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
|
||||
break;
|
||||
case CB_UPDATE_ASSETS:
|
||||
event_cmd_ctl(EVENT_CMD_REINIT, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (err)
|
||||
@ -1291,6 +1303,9 @@ static void cb_generic_download(void *task_data,
|
||||
* http transfer. */
|
||||
switch (transf->type_hash)
|
||||
{
|
||||
case CB_CORE_THUMBNAILS_DOWNLOAD:
|
||||
dir_path = settings->thumbnails_directory;
|
||||
break;
|
||||
case CB_CORE_UPDATER_DOWNLOAD:
|
||||
dir_path = settings->libretro_directory;
|
||||
break;
|
||||
@ -1341,6 +1356,7 @@ static void cb_generic_download(void *task_data,
|
||||
|
||||
fill_pathname_join(output_path, dir_path,
|
||||
transf->path, sizeof(output_path));
|
||||
RARCH_LOG("output_path: %s\n", output_path);
|
||||
|
||||
/* Make sure the directory exists */
|
||||
path_basedir(output_path);
|
||||
@ -1371,8 +1387,12 @@ static void cb_generic_download(void *task_data,
|
||||
cb_decompressed, (void*)(uintptr_t)transf->type_hash);
|
||||
}
|
||||
#else
|
||||
if (transf->type_hash == CB_CORE_UPDATER_DOWNLOAD)
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
|
||||
switch (transf->type_hash)
|
||||
{
|
||||
case CB_CORE_UPDATER_DOWNLOAD:
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
finish:
|
||||
@ -1440,6 +1460,10 @@ static int action_ok_download_generic(const char *path,
|
||||
path = "shaders_glsl.zip";
|
||||
else if (string_is_equal(type_msg, "cb_update_shaders_cg"))
|
||||
path = "shaders_cg.zip";
|
||||
else if (string_is_equal(type_msg, "cb_core_thumbnails_download"))
|
||||
{
|
||||
strlcpy(s, "http://ia800500.us.archive.org/33/items/No-Intro-Collection_2015-03-03", sizeof(s));
|
||||
}
|
||||
else
|
||||
strlcpy(s, settings->network.buildbot_url, sizeof(s));
|
||||
|
||||
@ -1461,6 +1485,20 @@ static int action_ok_core_content_download(const char *path,
|
||||
"cb_core_content_download");
|
||||
}
|
||||
|
||||
static int action_ok_core_content_thumbnails(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
return action_ok_download_generic(path, label, type, idx, entry_idx,
|
||||
"cb_core_thumbnails_download");
|
||||
}
|
||||
|
||||
static int action_ok_thumbnails_updater_download(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
return action_ok_download_generic(path, label, type, idx, entry_idx,
|
||||
"cb_thumbnails_updater_download");
|
||||
}
|
||||
|
||||
static int action_ok_core_updater_download(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
@ -1637,6 +1675,7 @@ enum
|
||||
{
|
||||
ACTION_OK_NETWORK_CORE_CONTENT_LIST = 0,
|
||||
ACTION_OK_NETWORK_CORE_UPDATER_LIST,
|
||||
ACTION_OK_NETWORK_THUMBNAILS_UPDATER_LIST,
|
||||
ACTION_OK_NETWORK_LAKKA_LIST
|
||||
};
|
||||
|
||||
@ -1674,6 +1713,14 @@ static int generic_action_ok_network(const char *path,
|
||||
type_id2 = ACTION_OK_DL_CORE_UPDATER_LIST;
|
||||
callback = cb_net_generic;
|
||||
break;
|
||||
case ACTION_OK_NETWORK_THUMBNAILS_UPDATER_LIST:
|
||||
fill_pathname_join(url_path,
|
||||
"http://ia801501.us.archive.org/24/items/No-Intro_Thumbnails_2016-04-10",
|
||||
"index", sizeof(url_path));
|
||||
url_label = "cb_thumbnails_updater_list";
|
||||
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
|
||||
callback = cb_net_generic;
|
||||
break;
|
||||
#ifdef HAVE_LAKKA
|
||||
case ACTION_OK_NETWORK_LAKKA_LIST:
|
||||
/* TODO unhardcode this path */
|
||||
@ -1708,6 +1755,13 @@ static int action_ok_core_updater_list(const char *path,
|
||||
ACTION_OK_NETWORK_CORE_UPDATER_LIST);
|
||||
}
|
||||
|
||||
static int action_ok_thumbnails_updater_list(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
||||
ACTION_OK_NETWORK_THUMBNAILS_UPDATER_LIST);
|
||||
}
|
||||
|
||||
static int action_ok_lakka_list(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
@ -2318,6 +2372,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
||||
case MENU_LABEL_VALUE_CORE_UPDATER_LIST:
|
||||
BIND_ACTION_OK(cbs, action_ok_core_updater_list);
|
||||
break;
|
||||
case MENU_LABEL_THUMBNAILS_UPDATER_LIST:
|
||||
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_list);
|
||||
break;
|
||||
case MENU_LABEL_UPDATE_LAKKA:
|
||||
BIND_ACTION_OK(cbs, action_ok_lakka_list);
|
||||
break;
|
||||
@ -2583,9 +2640,15 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
||||
case MENU_FILE_DOWNLOAD_CORE_CONTENT:
|
||||
BIND_ACTION_OK(cbs, action_ok_core_content_download);
|
||||
break;
|
||||
case MENU_FILE_DOWNLOAD_THUMBNAIL_CONTENT:
|
||||
BIND_ACTION_OK(cbs, action_ok_core_content_thumbnails);
|
||||
break;
|
||||
case MENU_FILE_DOWNLOAD_CORE:
|
||||
BIND_ACTION_OK(cbs, action_ok_core_updater_download);
|
||||
break;
|
||||
case MENU_FILE_DOWNLOAD_THUMBNAIL:
|
||||
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_download);
|
||||
break;
|
||||
case MENU_FILE_DOWNLOAD_LAKKA:
|
||||
BIND_ACTION_OK(cbs, action_ok_lakka_download);
|
||||
break;
|
||||
|
@ -620,6 +620,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
|
||||
return "take_screenshot";
|
||||
case MENU_LABEL_CORE_UPDATER_LIST:
|
||||
return "core_updater_list";
|
||||
case MENU_LABEL_THUMBNAILS_UPDATER_LIST:
|
||||
return "thumbnails_updater_list";
|
||||
case MENU_LABEL_CORE_UPDATER_BUILDBOT_URL:
|
||||
return "core_updater_buildbot_url";
|
||||
case MENU_LABEL_BUILDBOT_ASSETS_URL:
|
||||
@ -708,6 +710,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
|
||||
return "deferred_video_filter";
|
||||
case MENU_LABEL_DEFERRED_CORE_UPDATER_LIST:
|
||||
return "core_updater";
|
||||
case MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
||||
return "deferred_thumbnails_updater_list";
|
||||
case MENU_LABEL_AUDIO_DSP_PLUGIN:
|
||||
return "audio_dsp_plugin";
|
||||
case MENU_LABEL_UPDATE_ASSETS:
|
||||
@ -750,6 +754,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
case MENU_LABEL_VALUE_THUMBNAILS_UPDATER_LIST:
|
||||
return "Thumbnails Updater";
|
||||
case MENU_LABEL_VALUE_MENU_LINEAR_FILTER:
|
||||
return "Menu Linear Filter";
|
||||
case MENU_LABEL_VALUE_MENU_THROTTLE_FRAMERATE:
|
||||
|
@ -76,6 +76,7 @@ enum
|
||||
ACTION_OK_DL_DATABASE_MANAGER_LIST,
|
||||
ACTION_OK_DL_CURSOR_MANAGER_LIST,
|
||||
ACTION_OK_DL_CORE_UPDATER_LIST,
|
||||
ACTION_OK_DL_THUMBNAILS_UPDATER_LIST,
|
||||
ACTION_OK_DL_CORE_CONTENT_LIST,
|
||||
ACTION_OK_DL_DEFERRED_CORE_LIST,
|
||||
ACTION_OK_DL_DEFERRED_CORE_LIST_SET,
|
||||
|
@ -100,34 +100,40 @@ static void print_buf_lines(file_list_t *list, char *buf, int buf_size,
|
||||
|
||||
menu_entries_add(list, line_start, "",
|
||||
type, 0, 0);
|
||||
if (type == MENU_FILE_DOWNLOAD_CORE)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings)
|
||||
{
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
char display_name[PATH_MAX_LENGTH];
|
||||
char *last = NULL;
|
||||
|
||||
fill_pathname_join(core_path, settings->libretro_info_path,
|
||||
line_start, sizeof(core_path));
|
||||
|
||||
path_remove_extension(core_path);
|
||||
path_remove_extension(core_path);
|
||||
last = (char*)strrchr(core_path, '_');
|
||||
if (*last)
|
||||
case MENU_FILE_DOWNLOAD_CORE:
|
||||
{
|
||||
if (!string_is_equal(last, "_libretro"))
|
||||
*last = '\0';
|
||||
}
|
||||
strlcat(core_path, ".info", sizeof(core_path));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (core_info_get_display_name(
|
||||
core_path, display_name, sizeof(display_name)))
|
||||
menu_entries_set_alt_at_offset(list, j, display_name);
|
||||
}
|
||||
if (settings)
|
||||
{
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
char display_name[PATH_MAX_LENGTH];
|
||||
char *last = NULL;
|
||||
|
||||
fill_pathname_join(core_path, settings->libretro_info_path,
|
||||
line_start, sizeof(core_path));
|
||||
|
||||
path_remove_extension(core_path);
|
||||
path_remove_extension(core_path);
|
||||
last = (char*)strrchr(core_path, '_');
|
||||
if (*last)
|
||||
{
|
||||
if (!string_is_equal(last, "_libretro"))
|
||||
*last = '\0';
|
||||
}
|
||||
strlcat(core_path, ".info", sizeof(core_path));
|
||||
|
||||
if (core_info_get_display_name(
|
||||
core_path, display_name, sizeof(display_name)))
|
||||
menu_entries_set_alt_at_offset(list, j, display_name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
j++;
|
||||
|
||||
/* Restore the saved char */
|
||||
@ -199,34 +205,40 @@ static void print_buf_lines_extended(file_list_t *list, char *buf, int buf_size,
|
||||
|
||||
menu_entries_add(list, core_pathname, "",
|
||||
type, 0, 0);
|
||||
if (type == MENU_FILE_DOWNLOAD_CORE)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings)
|
||||
{
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
char display_name[PATH_MAX_LENGTH];
|
||||
char *last = NULL;
|
||||
|
||||
fill_pathname_join(core_path, settings->libretro_info_path,
|
||||
core_pathname, sizeof(core_path));
|
||||
|
||||
path_remove_extension(core_path);
|
||||
path_remove_extension(core_path);
|
||||
last = (char*)strrchr(core_path, '_');
|
||||
if (*last)
|
||||
case MENU_FILE_DOWNLOAD_CORE:
|
||||
{
|
||||
if (!string_is_equal(last, "_libretro"))
|
||||
*last = '\0';
|
||||
}
|
||||
strlcat(core_path, ".info", sizeof(core_path));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (core_info_get_display_name(
|
||||
core_path, display_name, sizeof(display_name)))
|
||||
menu_entries_set_alt_at_offset(list, j, display_name);
|
||||
}
|
||||
if (settings)
|
||||
{
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
char display_name[PATH_MAX_LENGTH];
|
||||
char *last = NULL;
|
||||
|
||||
fill_pathname_join(core_path, settings->libretro_info_path,
|
||||
core_pathname, sizeof(core_path));
|
||||
|
||||
path_remove_extension(core_path);
|
||||
path_remove_extension(core_path);
|
||||
last = (char*)strrchr(core_path, '_');
|
||||
if (*last)
|
||||
{
|
||||
if (!string_is_equal(last, "_libretro"))
|
||||
*last = '\0';
|
||||
}
|
||||
strlcat(core_path, ".info", sizeof(core_path));
|
||||
|
||||
if (core_info_get_display_name(
|
||||
core_path, display_name, sizeof(display_name)))
|
||||
menu_entries_set_alt_at_offset(list, j, display_name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
j++;
|
||||
|
||||
string_list_free(str_list);
|
||||
@ -2385,6 +2397,11 @@ static int menu_displaylist_parse_options(
|
||||
menu_hash_to_str(MENU_LABEL_CORE_UPDATER_LIST),
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
menu_entries_add(info->list,
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_THUMBNAILS_UPDATER_LIST),
|
||||
menu_hash_to_str(MENU_LABEL_THUMBNAILS_UPDATER_LIST),
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
menu_entries_add(info->list,
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_UPDATE_CORE_INFO_FILES),
|
||||
menu_hash_to_str(MENU_LABEL_UPDATE_CORE_INFO_FILES),
|
||||
@ -3110,6 +3127,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
case DISPLAYLIST_CORES:
|
||||
case DISPLAYLIST_CORES_DETECTED:
|
||||
case DISPLAYLIST_CORES_UPDATER:
|
||||
case DISPLAYLIST_THUMBNAILS_UPDATER:
|
||||
case DISPLAYLIST_LAKKA:
|
||||
case DISPLAYLIST_CORES_SUPPORTED:
|
||||
case DISPLAYLIST_CORES_COLLECTION_SUPPORTED:
|
||||
@ -3640,6 +3658,14 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
core_len, MENU_FILE_DOWNLOAD_CORE);
|
||||
info->need_push = true;
|
||||
info->need_refresh = true;
|
||||
#endif
|
||||
break;
|
||||
case DISPLAYLIST_THUMBNAILS_UPDATER:
|
||||
#ifdef HAVE_NETWORKING
|
||||
print_buf_lines(info->list, core_buf,
|
||||
core_len, MENU_FILE_DOWNLOAD_THUMBNAIL_CONTENT);
|
||||
info->need_push = true;
|
||||
info->need_refresh = true;
|
||||
#endif
|
||||
break;
|
||||
case DISPLAYLIST_LAKKA:
|
||||
|
@ -63,6 +63,7 @@ enum menu_displaylist_ctl_state
|
||||
DISPLAYLIST_CORES_SUPPORTED,
|
||||
DISPLAYLIST_CORES_COLLECTION_SUPPORTED,
|
||||
DISPLAYLIST_CORES_UPDATER,
|
||||
DISPLAYLIST_THUMBNAILS_UPDATER,
|
||||
DISPLAYLIST_LAKKA,
|
||||
DISPLAYLIST_CORES_DETECTED,
|
||||
DISPLAYLIST_CORE_OPTIONS,
|
||||
|
@ -199,6 +199,7 @@ enum menu_file_type
|
||||
MENU_FILE_DOWNLOAD_CORE,
|
||||
MENU_FILE_DOWNLOAD_CORE_CONTENT,
|
||||
MENU_FILE_DOWNLOAD_CORE_INFO,
|
||||
MENU_FILE_DOWNLOAD_THUMBNAIL_CONTENT,
|
||||
MENU_FILE_DOWNLOAD_LAKKA,
|
||||
MENU_FILE_RDB,
|
||||
MENU_FILE_RDB_ENTRY,
|
||||
@ -234,6 +235,7 @@ enum menu_file_type
|
||||
MENU_SETTING_SUBGROUP,
|
||||
MENU_SETTING_HORIZONTAL_MENU,
|
||||
MENU_INFO_MESSAGE,
|
||||
MENU_FILE_DOWNLOAD_THUMBNAIL,
|
||||
MENU_FILE_TYPE_T_LAST
|
||||
};
|
||||
|
||||
|
@ -20,6 +20,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CB_THUMBNAILS_UPDATER_DOWNLOAD 0xf4ee156bU
|
||||
|
||||
#define MENU_LABEL_THUMBNAILS_UPDATER_LIST 0xff70176bU
|
||||
#define MENU_LABEL_VALUE_THUMBNAILS_UPDATER_LIST 0x75028b11U
|
||||
|
||||
#define MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST 0x364dfa2bU
|
||||
|
||||
#define MENU_LABEL_MENU_LINEAR_FILTER 0x5fe9128cU
|
||||
#define MENU_LABEL_VALUE_MENU_LINEAR_FILTER 0x192de208U
|
||||
|
||||
@ -1155,6 +1162,8 @@ extern "C" {
|
||||
#define MENU_LABEL_INPUT_ICADE_ENABLE 0xcd534dd0U
|
||||
#define MENU_LABEL_VALUE_INPUT_ICADE_ENABLE 0x67b18ee2U
|
||||
|
||||
#define CB_CORE_THUMBNAILS_DOWNLOAD 0xc9d6519fU
|
||||
|
||||
const char *menu_hash_to_str_de(uint32_t hash);
|
||||
int menu_hash_get_help_de(uint32_t hash, char *s, size_t len);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user