audioplayer: fix loading of radio-favorites.xml

Origin commit data
------------------
Branch: ni/coolstream
Commit: f49a8fe9b9
Author: vanhofen <vanhofen@gmx.de>
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
This commit is contained in:
vanhofen
2017-06-28 15:12:00 +02:00
parent 102866f71d
commit e8594b03e2

View File

@@ -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; 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()) if (m_playlist.empty())
m_current = -1; m_current = -1;
else else
@@ -378,18 +385,15 @@ int CAudioPlayerGui::show()
bool clear_before_update = false; bool clear_before_update = false;
m_key_level = 0; 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 //NI auto-play first entry from favorites
if (g_settings.inetradio_autostart) if (g_settings.inetradio_autostart)
{ {
if ((m_inetmode) && (!m_playlist.empty())) if ((m_inetmode) && (!m_playlist.empty()))
{
m_current = 0;
m_selected = 0;
play(m_selected); play(m_selected);
}
} }
while (loop) while (loop)