Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return server error if channels or groups could not be loaded due to … #549

Open
wants to merge 1 commit into
base: Leia
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pvr.iptvsimple/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.iptvsimple"
version="3.10.1"
version="3.10.2"
name="PVR IPTV Simple Client"
provider-name="nightik">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 10 additions & 2 deletions src/PVRIptvData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ PVRIptvData::PVRIptvData(void)
m_epg.clear();
m_genres.clear();

LoadPlayList();
m_PlayListLoaded = LoadPlayList();
}

void *PVRIptvData::Process(void)
Expand All @@ -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)
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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<PVRIptvChannelGroup>::iterator it;
for (it = m_groups.begin(); it != m_groups.end(); ++it)
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/PVRIptvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ class PVRIptvData : public P8PLATFORM::CThread
std::vector<PVRIptvEpgChannel> m_epg;
std::vector<PVRIptvEpgGenre> m_genres;
P8PLATFORM::CMutex m_mutex;
bool m_PlayListLoaded;
};