From 34a0b8370efc860190518ee5ff1ab9f23af7cdbe Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 20 Mar 2023 15:29:25 +0000 Subject: [PATCH 1/2] Support async connect --- src/IptvSimple.cpp | 10 +++++++++- src/iptvsimple/PlaylistLoader.cpp | 6 +++++- src/iptvsimple/PlaylistLoader.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/IptvSimple.cpp b/src/IptvSimple.cpp index c19c0a503..86fe3f06b 100644 --- a/src/IptvSimple.cpp +++ b/src/IptvSimple.cpp @@ -35,6 +35,8 @@ bool IptvSimple::Initialise() { std::lock_guard lock(m_mutex); + ConnectionStateChange("", PVR_CONNECTION_STATE_CONNECTING, ""); + m_channels.Init(); m_channelGroups.Init(); m_providers.Init(); @@ -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()); @@ -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; diff --git a/src/iptvsimple/PlaylistLoader.cpp b/src/iptvsimple/PlaylistLoader.cpp index 75e32a712..ccf29d746 100644 --- a/src/iptvsimple/PlaylistLoader.cpp +++ b/src/iptvsimple/PlaylistLoader.cpp @@ -517,7 +517,7 @@ void PlaylistLoader::ParseSinglePropertyIntoChannel(const std::string& line, Cha } } -void PlaylistLoader::ReloadPlayList() +bool PlaylistLoader::ReloadPlayList() { m_m3uLocation = m_settings->GetM3ULocation(); @@ -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; } } diff --git a/src/iptvsimple/PlaylistLoader.h b/src/iptvsimple/PlaylistLoader.h index 593c93ef8..8d2009f96 100644 --- a/src/iptvsimple/PlaylistLoader.h +++ b/src/iptvsimple/PlaylistLoader.h @@ -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); From bf898c1e4baf0e2999ac134128c536dd6ceeabc6 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 20 Mar 2023 15:57:14 +0000 Subject: [PATCH 2/2] changelog and version 20.9.0 --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 039a18707..819af9625 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 5930e29a1..a023cd75f 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v20.9.0 +- Support async connect + v20.8.1 - Set default settings correctly and update settings migration