Fix playlist sublabels

This commit is contained in:
jdgleaver 2020-02-24 10:22:44 +00:00
parent 0c17faa78f
commit 27c5ffeb76
1 changed files with 20 additions and 26 deletions

View File

@ -1102,39 +1102,33 @@ static int action_bind_sublabel_playlist_entry(
!string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU))) !string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)))
return 0; return 0;
switch (entry->runtime_status) /* Check whether runtime info should be loaded from log file */
if (entry->runtime_status == PLAYLIST_RUNTIME_UNKNOWN)
runtime_update_playlist(playlist, i);
/* Check whether runtime info is valid */
if (entry->runtime_status == PLAYLIST_RUNTIME_VALID)
{ {
case PLAYLIST_RUNTIME_UNKNOWN: int n = 0;
/* Check whether runtime info should be loaded from log file */ char tmp[64];
runtime_update_playlist(playlist, i);
break;
case PLAYLIST_RUNTIME_VALID:
/* Check whether runtime info is valid */
{
int n = 0;
char tmp[64];
tmp[0 ] = '\n'; tmp[0 ] = '\n';
tmp[1 ] = '\0'; tmp[1 ] = '\0';
n = strlcat(tmp, entry->runtime_str, sizeof(tmp)); n = strlcat(tmp, entry->runtime_str, sizeof(tmp));
tmp[n ] = '\n'; tmp[n ] = '\n';
tmp[n+1] = '\0'; tmp[n+1] = '\0';
/* Runtime/last played strings are now cached in the /* Runtime/last played strings are now cached in the
* playlist, so we can add both in one go */ * playlist, so we can add both in one go */
n = strlcat(tmp, entry->last_played_str, sizeof(tmp)); n = strlcat(tmp, entry->last_played_str, sizeof(tmp));
if ((n < 0) || (n >= 64)) if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */ n = 0; /* Silence GCC warnings... */
if (!string_is_empty(tmp)) if (!string_is_empty(tmp))
strlcat(s, tmp, len); strlcat(s, tmp, len);
}
break;
default:
break;
} }
return 0; return 0;