From e8594b03e24ffe2967c44d5283a543a01586f005 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 28 Jun 2017 15:12:00 +0200 Subject: [PATCH] audioplayer: fix loading of radio-favorites.xml Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f49a8fe9b9ae04dc1efc9f019fa4f5b6dd43cf0b Author: vanhofen Date: 2017-06-28 (Wed, 28 Jun 2017) Origin message was: ------------------ - audioplayer: fix loading of radio-favorites.xml ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index cb1be808a..bae1a1217 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -282,6 +282,13 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_select_title_by_name = g_settings.audioplayer_select_title_by_name; } + //NI auto-load favorites + if ((m_inetmode) && (m_playlist.empty())) + { + if (access(RADIO_FAVORITES_XML_FILE, F_OK) == 0) + scanXmlFile(RADIO_FAVORITES_XML_FILE); + } + if (m_playlist.empty()) m_current = -1; else @@ -378,18 +385,15 @@ int CAudioPlayerGui::show() bool clear_before_update = false; m_key_level = 0; - //NI auto-load favorites - if ((m_inetmode) && (m_playlist.empty())) - { - if (access(RADIO_FAVORITES_XML_FILE, F_OK) == 0) - scanXmlFile(RADIO_FAVORITES_XML_FILE); - } - //NI auto-play first entry from favorites if (g_settings.inetradio_autostart) { if ((m_inetmode) && (!m_playlist.empty())) + { + m_current = 0; + m_selected = 0; play(m_selected); + } } while (loop)