Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gfx/gfx_thumbnail_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ bool gfx_thumbnail_set_content_playlist(

/* Thumbnail image name is done -> now check if
* 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))
{
/* Hack: There is only one MAME thumbnail repo,
Expand Down
41 changes: 22 additions & 19 deletions playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -3191,28 +3191,31 @@ void playlist_get_crc32(playlist_t *playlist, size_t idx,
void playlist_get_db_name(playlist_t *playlist, size_t idx,
const char **db_name)
{
if (!playlist || idx >= RBUF_LEN(playlist->entries))
if (!playlist || !db_name || idx >= RBUF_LEN(playlist->entries))
return;

if (db_name)
if (!string_is_empty(playlist->entries[idx].db_name))
*db_name = playlist->entries[idx].db_name;
else
{
if (!string_is_empty(playlist->entries[idx].db_name))
*db_name = playlist->entries[idx].db_name;
else
{
const char *conf_path_basename = path_basename_nocompression(playlist->config.path);

/* Only use file basename if this is a 'collection' playlist
* (i.e. ignore history/favourites) */
if (
!string_is_empty(conf_path_basename)
&& !string_is_equal(conf_path_basename,
FILE_PATH_CONTENT_HISTORY)
&& !string_is_equal(conf_path_basename,
FILE_PATH_CONTENT_FAVORITES)
)
*db_name = conf_path_basename;
}
const char *conf_path_basename = path_basename_nocompression(playlist->config.path);

/* Only use file basename if this is a 'collection' playlist
* (i.e. ignore history/favourites) */
if (
!string_is_empty(conf_path_basename)
&& !string_is_equal(conf_path_basename,
FILE_PATH_CONTENT_HISTORY)
&& !string_is_equal(conf_path_basename,
FILE_PATH_CONTENT_FAVORITES)
)
*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;
}
}
}

Expand Down
Loading