From 5ee5e918931b0b75ae1894ff4664c989c8829d14 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 5 Jan 2024 11:56:28 +0000 Subject: [PATCH 1/3] Remove unused variable --- src/iptvsimple/ConnectionManager.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/iptvsimple/ConnectionManager.h b/src/iptvsimple/ConnectionManager.h index a9609768..a2a88db5 100644 --- a/src/iptvsimple/ConnectionManager.h +++ b/src/iptvsimple/ConnectionManager.h @@ -50,7 +50,6 @@ namespace iptvsimple PVR_CONNECTION_STATE m_state; bool m_onStartupOnly = true; - bool m_notifyStateChangeToUser = false; std::shared_ptr m_settings; }; From 9b356e9dbc4d08b5b9107109b289262cf1a85cc3 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 5 Jan 2024 11:56:56 +0000 Subject: [PATCH 2/3] Fix supporting of local paths in Connection Manager --- src/iptvsimple/ConnectionManager.cpp | 4 +++- src/iptvsimple/utilities/WebUtils.cpp | 8 +++++++- src/iptvsimple/utilities/WebUtils.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/iptvsimple/ConnectionManager.cpp b/src/iptvsimple/ConnectionManager.cpp index b1ae5fd3..c1758d3e 100644 --- a/src/iptvsimple/ConnectionManager.cpp +++ b/src/iptvsimple/ConnectionManager.cpp @@ -141,6 +141,8 @@ void ConnectionManager::Process() } const std::string url = m_settings->GetM3ULocation(); + int tcpTimeout = m_settings->GetConnectioncCheckTimeoutSecs(); + bool isLocalPath = m_settings->GetM3UPathType() == PathType::LOCAL_PATH; /* URL is set */ if (url.empty()) @@ -151,7 +153,7 @@ void ConnectionManager::Process() } /* Connect */ - if ((firstRun || !m_onStartupOnly) && !WebUtils::Check(url, m_settings->GetConnectioncCheckTimeoutSecs())) + if ((firstRun || !m_onStartupOnly) && !WebUtils::Check(url, tcpTimeout, isLocalPath)) { /* Unable to connect */ if (retryAttempt == 0) diff --git a/src/iptvsimple/utilities/WebUtils.cpp b/src/iptvsimple/utilities/WebUtils.cpp index 5061355c..bef63527 100644 --- a/src/iptvsimple/utilities/WebUtils.cpp +++ b/src/iptvsimple/utilities/WebUtils.cpp @@ -7,6 +7,7 @@ #include "WebUtils.h" +#include "FileUtils.h" #include "Logger.h" #include @@ -130,8 +131,13 @@ std::string WebUtils::RedactUrl(const std::string& url) return redactedUrl; } -bool WebUtils::Check(const std::string& strURL, int connectionTimeoutSecs) +bool WebUtils::Check(const std::string& strURL, int connectionTimeoutSecs, bool isLocalPath) { + // For local paths we only need to check existence of the file + if (isLocalPath && FileUtils::FileExists(strURL)) + return true; + + //Otherwise it's remote kodi::vfs::CFile fileHandle; if (!fileHandle.CURLCreate(strURL)) { diff --git a/src/iptvsimple/utilities/WebUtils.h b/src/iptvsimple/utilities/WebUtils.h index 0fc1fa94..1b358f2f 100644 --- a/src/iptvsimple/utilities/WebUtils.h +++ b/src/iptvsimple/utilities/WebUtils.h @@ -27,7 +27,7 @@ namespace iptvsimple static std::string ReadFileContentsStartOnly(const std::string& url, int* httpCode); static bool IsHttpUrl(const std::string& url); static std::string RedactUrl(const std::string& url); - static bool Check(const std::string& url, int connectionTimeoutSecs); + static bool Check(const std::string& url, int connectionTimeoutSecs, bool isLocalPath = false); }; } // namespace utilities } // namespace iptvsimple From 4b8bfa738b81a23dda43470134d65fd3cbda25ee Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 5 Jan 2024 11:58:13 +0000 Subject: [PATCH 3/3] changelog and version 21.7.1 --- 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 4ebb52bc..60954a5b 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 4b68ed85..eb7668fb 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v21.7.1 +- Fix supporting of local paths in Connection Manager + v21.7.0 - Add connection manager support to wait for a valid M3U file before starting the add-on instance - The minimum refresh interval for the M3U should be 1 minutes and not zero, as that would be infinite refresh