Skip to content

Commit

Permalink
Merge pull request #723 from phunkyfish/async-connect-nexus
Browse files Browse the repository at this point in the history
Async connect nexus
  • Loading branch information
phunkyfish authored Mar 20, 2023
2 parents 6cef720 + bf898c1 commit b6c18e7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
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="20.8.1"
version="20.9.0"
name="IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
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 @@
v20.9.0
- Support async connect

v20.8.1
- Set default settings correctly and update settings migration

Expand Down
10 changes: 9 additions & 1 deletion src/IptvSimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ bool IptvSimple::Initialise()
{
std::lock_guard<std::mutex> lock(m_mutex);

ConnectionStateChange("", PVR_CONNECTION_STATE_CONNECTING, "");

m_channels.Init();
m_channelGroups.Init();
m_providers.Init();
Expand All @@ -43,6 +45,11 @@ bool IptvSimple::Initialise()
{
m_channels.ChannelsLoadFailed();
m_channelGroups.ChannelGroupsLoadFailed();
ConnectionStateChange("", PVR_CONNECTION_STATE_DISCONNECTED, "");
}
else
{
ConnectionStateChange("", PVR_CONNECTION_STATE_CONNECTED, "");
}
m_epg.Init(EpgMaxPastDays(), EpgMaxFutureDays());

Expand Down Expand Up @@ -116,7 +123,8 @@ void IptvSimple::Process()
std::this_thread::sleep_for(std::chrono::milliseconds(1000));

m_settings->ReloadAddonInstanceSettings();
m_playlistLoader.ReloadPlayList();
if (m_playlistLoader.ReloadPlayList())
ConnectionStateChange("", PVR_CONNECTION_STATE_CONNECTED, "");
m_epg.ReloadEPG(); // Reloading EPG also updates media

m_reloadChannelsGroupsAndEPG = false;
Expand Down
6 changes: 5 additions & 1 deletion src/iptvsimple/PlaylistLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void PlaylistLoader::ParseSinglePropertyIntoChannel(const std::string& line, Cha
}
}

void PlaylistLoader::ReloadPlayList()
bool PlaylistLoader::ReloadPlayList()
{
m_m3uLocation = m_settings->GetM3ULocation();

Expand All @@ -532,11 +532,15 @@ void PlaylistLoader::ReloadPlayList()
m_client->TriggerChannelGroupsUpdate();
m_client->TriggerProvidersUpdate();
m_client->TriggerRecordingUpdate();

return true;
}
else
{
m_channels.ChannelsLoadFailed();
m_channelGroups.ChannelGroupsLoadFailed();

return false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/iptvsimple/PlaylistLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace iptvsimple
bool Init();

bool LoadPlayList();
void ReloadPlayList();
bool ReloadPlayList();

private:
static std::string ReadMarkerValue(const std::string& line, const std::string& markerName);
Expand Down

0 comments on commit b6c18e7

Please sign in to comment.