From 87057f9aa44152675e1e69a1c33678bcdf6dc31b Mon Sep 17 00:00:00 2001 From: flubshi Date: Wed, 26 Jun 2024 20:10:42 +0200 Subject: [PATCH 1/2] Channel import: do not import locked channels --- src/WaipuData.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WaipuData.cpp b/src/WaipuData.cpp index 51abde1..e3e8076 100644 --- a/src/WaipuData.cpp +++ b/src/WaipuData.cpp @@ -820,6 +820,11 @@ bool WaipuData::LoadChannelData() { const auto& channel = doc[i]; const std::string waipuId = channel["stationId"].GetString(); + if (channel.HasMember("locked") && channel["locked"].GetBool()) + { + kodi::Log(ADDON_LOG_DEBUG, "[%s] Skip locked channel '%s'", __FUNCTION__, waipuId.c_str()); + continue; + } const auto& stationConfig = std::find_if(stationConfigs.begin(), stationConfigs.end(), @@ -1073,8 +1078,8 @@ PVR_ERROR WaipuData::GetChannelGroupMembers(const kodi::addon::PVRChannelGroup& { if (group.GetIsRadio()) { - kodi::Log(ADDON_LOG_ERROR, - "[%s] ERROR: Function was called with a group having 'radio: true'", __FUNCTION__); + kodi::Log(ADDON_LOG_ERROR, "[%s] ERROR: Function was called with a group having 'radio: true'", + __FUNCTION__); return PVR_ERROR_INVALID_PARAMETERS; } From 3b94b3c9e56271207967415a43ebeb2fd05855b1 Mon Sep 17 00:00:00 2001 From: flubshi Date: Wed, 26 Jun 2024 20:22:00 +0200 Subject: [PATCH 2/2] Recordings import: do not import locked recordings --- src/WaipuData.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/WaipuData.cpp b/src/WaipuData.cpp index e3e8076..75e0af5 100644 --- a/src/WaipuData.cpp +++ b/src/WaipuData.cpp @@ -1731,11 +1731,16 @@ PVR_ERROR WaipuData::GetRecordings(bool deleted, kodi::addon::PVRRecordingsResul if (recordingEntry.HasMember("recordingGroup") && recordingEntry["recordingGroup"].IsInt()) { int recordingGroup = recordingEntry["recordingGroup"].GetInt(); - kodi::Log(ADDON_LOG_DEBUG, "[recordings] found group: %i;", recordingGroup); + kodi::Log(ADDON_LOG_DEBUG, "[%s] found group: %i;", __FUNCTION__, recordingGroup); recordingGroups.insert(recordingGroup); } else if (status == "FINISHED" || status == "RECORDING") { + if (recordingEntry.HasMember("locked") && recordingEntry["locked"].GetBool()) + { + kodi::Log(ADDON_LOG_DEBUG, "[%s] Skip locked recording", __FUNCTION__); + continue; + } recordings_count++; results.Add(ParseRecordingEntry(recordingEntry)); } @@ -1765,6 +1770,11 @@ PVR_ERROR WaipuData::GetRecordings(bool deleted, kodi::addon::PVRRecordingsResul if (status != "FINISHED" && status != "RECORDING") continue; + if (recordingEntry.HasMember("locked") && recordingEntry["locked"].GetBool()) + { + kodi::Log(ADDON_LOG_DEBUG, "[%s] Skip locked recording", __FUNCTION__); + continue; + } recordings_count++; results.Add(ParseRecordingEntry(recordingEntry)); }