From 70ccbb6fb598637dda750e5087a3aa410c9d9f22 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 5 Nov 2018 13:59:38 +0100 Subject: [PATCH] Add customized string for 'no Music Available' --- intl/msg_hash_ar.h | 4 ++++ intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_el.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_es.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pl.h | 4 ++++ intl/msg_hash_pt_br.h | 4 ++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/menu_displaylist.c | 19 ++++++++++--------- menu/menu_displaylist.h | 2 ++ msg_hash.h | 1 + 22 files changed, 87 insertions(+), 9 deletions(-) diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index c041df1055..660389873a 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3706,3 +3706,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index f2ca0cd115..b3bd91ca77 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -4725,3 +4725,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 01b032fcc1..49c14a78c2 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3482,3 +3482,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 01e5e205ea..1e1867c016 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3618,3 +3618,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index 17ff133ff0..7cd7f05e22 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -7710,3 +7710,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index a2172786ad..4786ee10ee 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3357,3 +3357,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index dd588eee85..b693e7a0ba 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -7647,3 +7647,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index e0295b0c35..8fd36db65f 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3516,3 +3516,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index ba5f992d91..4faa7279cd 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3576,3 +3576,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 133b22d2c2..647be353cb 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -4025,3 +4025,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 22f613879a..5cdf33a748 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3477,3 +3477,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index fdd436f410..112fb8d7de 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1727,3 +1727,5 @@ MSG_HASH(MENU_ENUM_LABEL_RESET_TO_DEFAULT_CONFIG, "reset_to_default_config") MSG_HASH(MENU_ENUM_LABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME, "menu_use_preferred_system_color_theme") +MSG_HASH(MENU_ENUM_LABEL_NO_MUSIC_AVAILABLE, + "no_music") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index c82cf6d559..ccab66062c 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3363,3 +3363,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Hoger") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Hoogst") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "Geen muziek beschikbaar." + ) diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 9ca0b84ee1..d2a4754630 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3779,3 +3779,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index a58aa4e2cd..cff4dcaab4 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -7741,3 +7741,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 6e1c6df6d9..2efb0779ac 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3443,3 +3443,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 419bbd3c85..fc7c4af09d 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3646,3 +3646,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index f1bbb0d370..8136eaeb52 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -7741,3 +7741,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index b3376cbe61..f518f45856 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3516,3 +3516,7 @@ MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHER, "Higher") MSG_HASH(MSG_RESAMPLER_QUALITY_HIGHEST, "Highest") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE, + "No music available." + ) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index f141d903cc..d7eb157577 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1377,6 +1377,7 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info, else menu_entries_append_enum(info->list, label, path, MENU_ENUM_LABEL_PLAYLIST_ENTRY, FILE_TYPE_RPL_ENTRY, 0, i); + info->count++; free(path_copy); free(fill_buf); @@ -4052,18 +4053,14 @@ static void menu_displaylist_parse_playlist_generic( int *ret) { playlist_t *playlist = NULL; - char *path_playlist = NULL; menu_displaylist_set_new_playlist(menu, playlist_path); playlist = playlist_get_cached(); - path_playlist = strdup(playlist_name); if (playlist) *ret = menu_displaylist_parse_playlist(info, - playlist, path_playlist, true); - - free(path_playlist); + playlist, playlist_name, true); } #ifdef HAVE_NETWORKING @@ -4762,19 +4759,23 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist case DISPLAYLIST_MUSIC_HISTORY: { settings_t *settings = config_get_ptr(); + info->count = 0; + if (settings->bools.history_list_enable) menu_displaylist_parse_playlist_generic(menu, info, "music_history", settings->paths.path_content_music_history, &ret); - else + + if (info->count == 0) { menu_entries_append_enum(info->list, msg_hash_to_str( - MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE), - msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE), - MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE, + MENU_ENUM_LABEL_VALUE_NO_MUSIC_AVAILABLE), + msg_hash_to_str(MENU_ENUM_LABEL_NO_MUSIC_AVAILABLE), + MENU_ENUM_LABEL_NO_MUSIC_AVAILABLE, MENU_INFO_MESSAGE, 0, 0); + info->need_push_no_playlist_entries = false; ret = 0; } } diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 0ea063328d..e5e4b948cd 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -206,6 +206,8 @@ typedef struct menu_displaylist_info /* does the navigation index need to be cleared to 0 (first entry) ? */ bool need_navigation_clear; + unsigned count; + char *path; char *path_b; char *path_c; diff --git a/msg_hash.h b/msg_hash.h index 9e7b7b0433..fe45813f5d 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -438,6 +438,7 @@ enum msg_hash_enums MENU_LABEL(FILTER_BY_CURRENT_CORE), MENU_LABEL(NO_HISTORY_AVAILABLE), + MENU_LABEL(NO_MUSIC_AVAILABLE), MENU_ENUM_LABEL_DISCORD_IN_MENU, MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,