Skip to content

Commit

Permalink
Merge pull request #333 from flubshi/omega_hide_locked_channels
Browse files Browse the repository at this point in the history
Channel import: do not import locked channels
  • Loading branch information
flubshi authored Jun 26, 2024
2 parents 15ec47c + 3b94b3c commit 2ef51a1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/WaipuData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,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(),
Expand Down Expand Up @@ -1720,11 +1725,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));
}
Expand Down Expand Up @@ -1754,6 +1764,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));
}
Expand Down

0 comments on commit 2ef51a1

Please sign in to comment.