Fix thumbnails in History for content loaded through Load Content (#16025)

This commit is contained in:
Eric Warmenhoven 2023-12-21 16:48:34 -05:00 committed by GitHub
parent 799e56ca98
commit f4fbcd129e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 18 deletions

View File

@ -475,6 +475,8 @@ bool gfx_thumbnail_set_content_playlist(
/* Thumbnail image name is done -> now check if /* Thumbnail image name is done -> now check if
* per-content database name is defined */ * per-content database name is defined */
if (string_is_empty(db_name))
playlist_get_db_name(playlist, idx, &db_name);
if (!string_is_empty(db_name)) if (!string_is_empty(db_name))
{ {
/* Hack: There is only one MAME thumbnail repo, /* Hack: There is only one MAME thumbnail repo,

View File

@ -3191,11 +3191,9 @@ void playlist_get_crc32(playlist_t *playlist, size_t idx,
void playlist_get_db_name(playlist_t *playlist, size_t idx, void playlist_get_db_name(playlist_t *playlist, size_t idx,
const char **db_name) const char **db_name)
{ {
if (!playlist || idx >= RBUF_LEN(playlist->entries)) if (!playlist || !db_name || idx >= RBUF_LEN(playlist->entries))
return; return;
if (db_name)
{
if (!string_is_empty(playlist->entries[idx].db_name)) if (!string_is_empty(playlist->entries[idx].db_name))
*db_name = playlist->entries[idx].db_name; *db_name = playlist->entries[idx].db_name;
else else
@ -3212,6 +3210,11 @@ void playlist_get_db_name(playlist_t *playlist, size_t idx,
FILE_PATH_CONTENT_FAVORITES) FILE_PATH_CONTENT_FAVORITES)
) )
*db_name = conf_path_basename; *db_name = conf_path_basename;
else
{
core_info_t *core_info = playlist_entry_get_core_info(&playlist->entries[idx]);
if (core_info && core_info->databases)
*db_name = core_info->databases;
} }
} }
} }