Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ksooo committed Sep 6, 2024
1 parent f099c09 commit e5b8583
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions src/tvheadend/CustomTimerProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ std::vector<kodi::addon::PVRSettingKeyValuePair> CustomTimerProperties::GetPrope
}
case CUSTOM_PROP_ID_DVR_COMMENT:
{
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, rec.GetComment());
break;
if (m_conn.GetProtocol() >= 41)
{
/* user comment */
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, rec.GetComment());
break;
}
}
default:
Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId);
Expand Down Expand Up @@ -89,8 +93,12 @@ std::vector<kodi::addon::PVRSettingKeyValuePair> CustomTimerProperties::GetPrope
}
case CUSTOM_PROP_ID_DVR_COMMENT:
{
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, autorec.GetComment());
break;
if (m_conn.GetProtocol() >= 41)
{
/* user comment */
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, autorec.GetComment());
break;
}
}
default:
Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId);
Expand Down Expand Up @@ -121,8 +129,12 @@ std::vector<kodi::addon::PVRSettingKeyValuePair> CustomTimerProperties::GetPrope
}
case CUSTOM_PROP_ID_DVR_COMMENT:
{
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, timerec.GetComment());
break;
if (m_conn.GetProtocol() >= 41)
{
/* user comment */
customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, timerec.GetComment());
break;
}
}
default:
Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId);
Expand Down Expand Up @@ -179,15 +191,19 @@ const std::vector<kodi::addon::PVRSettingDefinition> CustomTimerProperties::GetS
}
case CUSTOM_PROP_ID_DVR_COMMENT:
{
std::string defaultValue;
const std::vector<kodi::addon::PVRTypeStringValue> values{
GetPossibleValues(CUSTOM_PROP_ID_DVR_COMMENT, defaultValue)};
// if (!values.empty())
/* User comment */
if (m_conn.GetProtocol() >= 41)
{
ret.emplace_back(CreateSettingDefinition(CUSTOM_PROP_ID_DVR_COMMENT,
30458, // Comment
values, defaultValue,
PVR_SETTING_READONLY_CONDITION_NONE));
std::string defaultValue;
const std::vector<kodi::addon::PVRTypeStringValue> values{
GetPossibleValues(CUSTOM_PROP_ID_DVR_COMMENT, defaultValue)};
// if (!values.empty())
{
ret.emplace_back(CreateSettingDefinition(CUSTOM_PROP_ID_DVR_COMMENT,
30458, // Comment
values, defaultValue,
PVR_SETTING_READONLY_CONDITION_NONE));
}
}
break;
}
Expand Down Expand Up @@ -256,10 +272,14 @@ const std::vector<kodi::addon::PVRTypeStringValue> CustomTimerProperties::GetPos
{
case CUSTOM_PROP_ID_DVR_COMMENT:
{
// Simple string prop, no pre-defined values; default is empty string.
static const std::vector<kodi::addon::PVRTypeStringValue> values{};
defaultValue = "";
return values;
if (m_conn.GetProtocol() >= 41)
{
// Simple string prop, no pre-defined values; default is empty string.
static const std::vector<kodi::addon::PVRTypeStringValue> values{};
defaultValue = "";
return values;
}
break;
}
default:
Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId);
Expand Down

0 comments on commit e5b8583

Please sign in to comment.