mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
tagtree: Improve suggested playlist filename for "special entries"
Make the suggested playlist filename for special entries such as "[Random]" or "[All Tracks]" a bit more descriptive, by mentioning the current table as well, e.g.: "The Beatles [All Tracks].m3u8", instead of just "[All Tracks].m3u8" Change-Id: I43d9386c06081540cdcae715afc0b0351857633d
This commit is contained in:
parent
10b4cab793
commit
7693ecc2a2
1 changed files with 20 additions and 2 deletions
22
apps/tree.c
22
apps/tree.c
|
@ -923,8 +923,26 @@ static int dirbrowse(void)
|
|||
else
|
||||
{
|
||||
attr = ATTR_DIRECTORY;
|
||||
tagtree_get_entry_name(&tc, tc.selected_item,
|
||||
buf, sizeof(buf));
|
||||
int title_len = 0;
|
||||
|
||||
/* In case of "special entries", add table title as
|
||||
prefix, e.g. "The Beatles [All Tracks]", instead
|
||||
of just "[All Tracks]", to improve the suggested
|
||||
playlist filename.
|
||||
*/
|
||||
if (tc.selected_item < tc.special_entry_count)
|
||||
{
|
||||
title_len = snprintf(buf, sizeof(buf), "%s ",
|
||||
tagtree_get_title(&tc));
|
||||
if (title_len < 0)
|
||||
title_len = 0;
|
||||
}
|
||||
|
||||
if (title_len < (int) sizeof(buf))
|
||||
tagtree_get_entry_name(&tc, tc.selected_item,
|
||||
buf + title_len,
|
||||
sizeof(buf) - title_len);
|
||||
|
||||
fix_path_part(buf, 0, sizeof(buf) - 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue