diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index a747e6a7b..220678025 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 90ff9ad2c..2e8d847f8 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v3.10.2 +- Fixed: Return server error if channels or groups could not be loaded due to missing file so they are not cleared in Kodi + v3.10.1 - Fixed: Addon crashes when it is restarted diff --git a/src/PVRIptvData.cpp b/src/PVRIptvData.cpp index 7abd12b92..fb16a2fd5 100644 --- a/src/PVRIptvData.cpp +++ b/src/PVRIptvData.cpp @@ -211,7 +211,7 @@ PVRIptvData::PVRIptvData(void) m_epg.clear(); m_genres.clear(); - LoadPlayList(); + m_PlayListLoaded = LoadPlayList(); } void *PVRIptvData::Process(void) @@ -225,6 +225,7 @@ PVRIptvData::~PVRIptvData(void) m_groups.clear(); m_epg.clear(); m_genres.clear(); + m_PlayListLoaded = false; } bool PVRIptvData::LoadEPG(time_t iStart, time_t iEnd) @@ -945,6 +946,9 @@ int PVRIptvData::GetChannelsAmount(void) PVR_ERROR PVRIptvData::GetChannels(ADDON_HANDLE handle, bool bRadio) { + if (!m_PlayListLoaded) + return PVR_ERROR_SERVER_ERROR; + P8PLATFORM::CLockObject lock(m_mutex); for (unsigned int iChannelPtr = 0; iChannelPtr < m_channels.size(); iChannelPtr++) { @@ -1001,6 +1005,9 @@ int PVRIptvData::GetChannelGroupsAmount(void) PVR_ERROR PVRIptvData::GetChannelGroups(ADDON_HANDLE handle, bool bRadio) { + if (!m_PlayListLoaded) + return PVR_ERROR_SERVER_ERROR; + P8PLATFORM::CLockObject lock(m_mutex); std::vector::iterator it; for (it = m_groups.begin(); it != m_groups.end(); ++it) @@ -1462,8 +1469,9 @@ void PVRIptvData::ReloadPlayList(const char * strNewPath) { m_strM3uUrl = strNewPath; m_channels.clear(); + m_PlayListLoaded = LoadPlayList(); - if (LoadPlayList()) + if (m_PlayListLoaded) { PVR->TriggerChannelUpdate(); PVR->TriggerChannelGroupsUpdate(); diff --git a/src/PVRIptvData.h b/src/PVRIptvData.h index 0807aaf98..b64985639 100644 --- a/src/PVRIptvData.h +++ b/src/PVRIptvData.h @@ -154,4 +154,5 @@ class PVRIptvData : public P8PLATFORM::CThread std::vector m_epg; std::vector m_genres; P8PLATFORM::CMutex m_mutex; + bool m_PlayListLoaded; };