mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-12 04:31:19 +00:00
Cut down on string_is_equals for history lists
This commit is contained in:
parent
c31bfb4dc8
commit
9364deb539
@ -1886,10 +1886,7 @@ static void menu_displaylist_set_new_playlist(
|
||||
/* Get proper playlist capacity */
|
||||
if (!string_is_empty(playlist_file_name))
|
||||
{
|
||||
if (string_is_equal(playlist_file_name, file_path_str(FILE_PATH_CONTENT_HISTORY)) ||
|
||||
string_is_equal(playlist_file_name, file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY)) ||
|
||||
string_is_equal(playlist_file_name, file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY)) ||
|
||||
string_is_equal(playlist_file_name, file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY)))
|
||||
if (string_ends_with(path, "_history.lpl"))
|
||||
playlist_size = content_history_size;
|
||||
else if (string_is_equal(playlist_file_name, file_path_str(FILE_PATH_CONTENT_FAVORITES)))
|
||||
if (content_favorites_size >= 0)
|
||||
@ -2704,11 +2701,10 @@ static unsigned menu_displaylist_parse_playlists(
|
||||
continue;
|
||||
|
||||
/* Ignore history/favourites */
|
||||
if (string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_FAVORITES)))
|
||||
if (
|
||||
string_ends_with(path, "_history.lpl")
|
||||
|| string_is_equal(playlist_file,
|
||||
file_path_str(FILE_PATH_CONTENT_FAVORITES)))
|
||||
continue;
|
||||
|
||||
file_type = FILE_TYPE_PLAYLIST_COLLECTION;
|
||||
@ -2974,11 +2970,10 @@ static unsigned menu_displaylist_parse_playlist_manager_list(
|
||||
/* Ignore history/favourites
|
||||
* > content_history + favorites are handled separately
|
||||
* > music/video/image_history are ignored */
|
||||
if (string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_FAVORITES)))
|
||||
if (
|
||||
string_ends_with(path, "_history.lpl")
|
||||
|| string_is_equal(playlist_file,
|
||||
file_path_str(FILE_PATH_CONTENT_FAVORITES)))
|
||||
continue;
|
||||
|
||||
menu_entries_append_enum(info->list,
|
||||
@ -3054,10 +3049,7 @@ static bool menu_displaylist_parse_playlist_manager_settings(
|
||||
return false;
|
||||
|
||||
/* Check whether this is a content history playlist */
|
||||
is_content_history = string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY)) ||
|
||||
string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY));
|
||||
is_content_history = string_ends_with(playlist_path, "_history.lpl");
|
||||
|
||||
/* Default core association
|
||||
* > This is only shown for collection playlists
|
||||
|
12
playlist.c
12
playlist.c
@ -2753,12 +2753,12 @@ void playlist_get_db_name(playlist_t *playlist, size_t idx,
|
||||
|
||||
/* 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_str(FILE_PATH_CONTENT_FAVORITES)) &&
|
||||
!string_is_equal(conf_path_basename, file_path_str(FILE_PATH_CONTENT_HISTORY)) &&
|
||||
!string_is_equal(conf_path_basename, file_path_str(FILE_PATH_CONTENT_IMAGE_HISTORY)) &&
|
||||
!string_is_equal(conf_path_basename, file_path_str(FILE_PATH_CONTENT_MUSIC_HISTORY)) &&
|
||||
!string_is_equal(conf_path_basename, file_path_str(FILE_PATH_CONTENT_VIDEO_HISTORY)))
|
||||
if (
|
||||
!string_is_empty(conf_path_basename)
|
||||
&& !string_ends_with(playlist->conf_path, "_history.lpl")
|
||||
&& !string_is_equal(conf_path_basename,
|
||||
file_path_str(FILE_PATH_CONTENT_FAVORITES))
|
||||
)
|
||||
*db_name = conf_path_basename;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user