mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-07 18:07:27 +00:00
Merge pull request #9401 from jdgleaver/favorites-fix
(Favourites) Fix 'remove entry' deleting wrong item
This commit is contained in:
commit
b3a4410e00
20
retroarch.c
20
retroarch.c
@ -5211,6 +5211,7 @@ TODO: Add a setting for these tweaks */
|
||||
break;
|
||||
case CMD_EVENT_ADD_TO_FAVORITES:
|
||||
{
|
||||
settings_t *settings = configuration_settings;
|
||||
struct string_list *str_list = (struct string_list*)data;
|
||||
|
||||
/* Check whether favourties playlist is at capacity */
|
||||
@ -5237,11 +5238,15 @@ TODO: Add a setting for these tweaks */
|
||||
entry.db_name = str_list->elems[5].data; /* db_name */
|
||||
|
||||
/* Write playlist entry */
|
||||
command_playlist_push_write(
|
||||
g_defaults.content_favorites,
|
||||
&entry
|
||||
);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
if (playlist_push(g_defaults.content_favorites, &entry))
|
||||
{
|
||||
/* New addition - need to resort if option is enabled */
|
||||
if (settings->bools.playlist_sort_alphabetical)
|
||||
playlist_qsort(g_defaults.content_favorites);
|
||||
|
||||
playlist_write_file(g_defaults.content_favorites);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25999,6 +26004,11 @@ void rarch_favorites_init(void)
|
||||
g_defaults.content_favorites = playlist_init(
|
||||
settings->paths.path_content_favorites,
|
||||
content_favorites_size);
|
||||
|
||||
/* Ensure that playlist is sorted alphabetically,
|
||||
* if required */
|
||||
if (settings->bools.playlist_sort_alphabetical)
|
||||
playlist_qsort(g_defaults.content_favorites);
|
||||
}
|
||||
|
||||
void rarch_favorites_deinit(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user