diff --git a/pvr.hts/resources/language/resource.language.en_gb/strings.po b/pvr.hts/resources/language/resource.language.en_gb/strings.po index e9c17902..a2face4a 100644 --- a/pvr.hts/resources/language/resource.language.en_gb/strings.po +++ b/pvr.hts/resources/language/resource.language.en_gb/strings.po @@ -451,7 +451,11 @@ msgctxt "#30457" msgid "DVR configuration" msgstr "" -#empty strings from id 30458 to 30499 +msgctxt "#30458" +msgid "Comment" +msgstr "" + +#empty strings from id 30459 to 30499 msgctxt "#30500" msgid "Streaming profile" diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 5cce422f..776a68f8 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -33,7 +33,7 @@ CTvheadend::CTvheadend(const kodi::addon::IInstanceInfo& instance) : kodi::addon::CInstancePVRClient(instance), m_settings(new InstanceSettings(*this)), m_conn(new HTSPConnection(m_settings, *this)), - m_customTimerProps({CUSTOM_PROP_ID_DVR_CONFIGURATION}, *m_conn, m_dvrConfigs), + m_customTimerProps({CUSTOM_PROP_ID_DVR_CONFIGURATION, CUSTOM_PROP_ID_DVR_COMMENT}, *m_conn, m_dvrConfigs), m_streamchange(false), m_vfs(new HTSPVFS(m_settings, *m_conn)), m_queue(static_cast(-1)), @@ -892,7 +892,7 @@ struct TimerType : kodi::addon::PVRTimerType unsigned int id, unsigned int attributes, const std::string& description, - const std::vector& customIntSettingDefs, + const std::vector& customSettingDefs, const std::vector& priorityValues, const std::vector& lifetimeValues, const std::vector& dupEpisodesValues = @@ -901,7 +901,7 @@ struct TimerType : kodi::addon::PVRTimerType SetId(id); SetAttributes(attributes); SetDescription(description); - SetCustomIntSettingDefinitions(customIntSettingDefs); + SetCustomSettingDefinitions(customSettingDefs); SetPriorities(priorityValues, settings->GetDvrPriority()); SetLifetimes(lifetimeValues, LifetimeMapper::TvhToKodi(settings->GetDvrLifetime())); SetPreventDuplicateEpisodes(dupEpisodesValues, settings->GetDvrDupdetect()); @@ -1004,8 +1004,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type /* Timer types definition. */ - /* Custom integer setting definitions */ - const std::vector customIntSettingDefs{ + /* Custom setting definitions */ + const std::vector customSettingDefs{ m_customTimerProps.GetSettingDefinitions()}; /* One-shot manual (time and channel based) */ @@ -1018,8 +1018,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_ONCE_MANUAL_ATTRIBS, /* Let Kodi generate the description. */ "", - /* Custom int settings definitions. */ - customIntSettingDefs, + /* Custom settings definitions. */ + customSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ @@ -1035,8 +1035,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_ONCE_EPG_ATTRIBS, /* Let Kodi generate the description. */ "", - /* Custom int settings definitions. */ - customIntSettingDefs, + /* Custom settings definitions. */ + customSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ @@ -1052,8 +1052,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_ONCE_MANUAL_ATTRIBS | PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES, /* Description. */ kodi::addon::GetLocalizedString(30350), // "One Time (Scheduled by timer rule)" - /* Custom int settings definitions. */ - customIntSettingDefs, + /* Custom settings definitions. */ + customSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ @@ -1069,16 +1069,16 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_ONCE_EPG_ATTRIBS | PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES, /* Description. */ kodi::addon::GetLocalizedString(30350), // "One Time (Scheduled by timer rule)" - /* Custom int settings definitions. */ - customIntSettingDefs, + /* Custom settings definitions. */ + customSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ lifetimeValues)); - /* Custom Timerec integer setting definitions */ - const std::vector customTimeRecIntSettingDefs{ - m_timeRecordings.GetCustomIntSettingDefinitions()}; + /* Custom Timerec setting definitions */ + const std::vector customTimeRecSettingDefs{ + m_timeRecordings.GetCustomSettingDefinitions()}; /* Repeating manual (time and channel based) - timerec */ types.emplace_back(TimerType( @@ -1094,16 +1094,16 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type PVR_TIMER_TYPE_SUPPORTS_LIFETIME | PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS, /* Let Kodi generate the description. */ "", - /* Custom int settings definitions. */ - customTimeRecIntSettingDefs, + /* Custom settings definitions. */ + customTimeRecSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ lifetimeValues)); /* Custom Autorec integer setting definitions */ - const std::vector customAutoRecIntSettingDefs{ - m_autoRecordings.GetCustomIntSettingDefinitions()}; + const std::vector customAutoRecSettingDefs{ + m_autoRecordings.GetCustomSettingDefinitions()}; if (m_conn->GetProtocol() >= 29) { @@ -1132,8 +1132,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_REPEATING_SERIESLINK_ATTRIBS, /* Description. */ kodi::addon::GetLocalizedString(30369), // "Timer rule (series link)" - /* Custom int settings definitions. */ - customAutoRecIntSettingDefs, + /* Custom settings definitions. */ + customAutoRecSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ @@ -1166,8 +1166,8 @@ PVR_ERROR CTvheadend::GetTimerTypes(std::vector& type TIMER_REPEATING_EPG_ATTRIBS, /* Let Kodi generate the description. */ "", - /* Custom int settings definitions. */ - customAutoRecIntSettingDefs, + /* Custom settings definitions. */ + customAutoRecSettingDefs, /* Values definitions for priorities. */ priorityValues, /* Values definitions for lifetime. */ @@ -1228,8 +1228,8 @@ bool CTvheadend::CreateTimer(const Recording& tvhTmr, kodi::addon::PVRTimer& tmr ? m_autoRecordings.GetTimerIntIdFromStringId(tvhTmr.GetAutorecId()) : 0); - /* Custom integer props */ - tmr.SetCustomIntProperties(m_customTimerProps.GetProperties(tvhTmr)); + /* Custom props */ + tmr.SetCustomProperties(m_customTimerProps.GetProperties(tvhTmr)); return true; } @@ -1314,8 +1314,8 @@ PVR_ERROR CTvheadend::AddTimer(const kodi::addon::PVRTimer& timer) LifetimeMapper::KodiToTvh(timer.GetLifetime())); // remove from disk htsmsg_add_u32(m, "priority", timer.GetPriority()); - /* Custom integer props. */ - m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomIntProperties(), m); + /* Custom props. */ + m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomProperties(), m); /* Send and Wait */ { @@ -1450,8 +1450,8 @@ PVR_ERROR CTvheadend::UpdateTimer(const kodi::addon::PVRTimer& timer) LifetimeMapper::KodiToTvh(timer.GetLifetime())); // remove from disk htsmsg_add_u32(m, "priority", timer.GetPriority()); - /* Custom integer props. */ - m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomIntProperties(), m); + /* Custom props. */ + m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomProperties(), m); return SendDvrUpdate(m); } @@ -2777,6 +2777,10 @@ void CTvheadend::ParseRecordingAddOrUpdate(htsmsg_t* msg, bool bAdd) if (str) rec.SetConfigUuid(str); + str = htsmsg_get_str(msg, "comment"); + if (str) + rec.SetComment(str); + if (m_conn->GetProtocol() >= 32) { if (rec.GetDescription().empty() && !rec.GetSubtitle().empty()) diff --git a/src/tvheadend/AutoRecordings.cpp b/src/tvheadend/AutoRecordings.cpp index 82485f1c..3af42147 100644 --- a/src/tvheadend/AutoRecordings.cpp +++ b/src/tvheadend/AutoRecordings.cpp @@ -28,8 +28,10 @@ AutoRecordings::AutoRecordings(const std::shared_ptr& settings Profiles& dvrConfigs) : m_settings(settings), m_conn(conn), - m_customTimerProps( - {CUSTOM_PROP_ID_DVR_CONFIGURATION, CUSTOM_PROP_ID_AUTOREC_BROADCASTTYPE}, conn, dvrConfigs) + m_customTimerProps({CUSTOM_PROP_ID_DVR_CONFIGURATION, CUSTOM_PROP_ID_AUTOREC_BROADCASTTYPE, + CUSTOM_PROP_ID_DVR_COMMENT}, + conn, + dvrConfigs) { } @@ -110,8 +112,8 @@ void AutoRecordings::GetAutorecTimers(std::vector& timers tmr.SetFullTextEpgSearch(rec.second.GetFulltext()); tmr.SetParentClientIndex(0); - /* Custom integer props. */ - tmr.SetCustomIntProperties(m_customTimerProps.GetProperties(rec.second)); + /* Custom props. */ + tmr.SetCustomProperties(m_customTimerProps.GetProperties(rec.second)); timers.emplace_back(std::move(tmr)); } @@ -141,8 +143,8 @@ const std::string AutoRecordings::GetTimerStringIdFromIntId(unsigned int intId) return ""; } -const std::vector AutoRecordings:: - GetCustomIntSettingDefinitions() const +const std::vector AutoRecordings::GetCustomSettingDefinitions() + const { return m_customTimerProps.GetSettingDefinitions(); } @@ -273,8 +275,8 @@ PVR_ERROR AutoRecordings::SendAutorecAddOrUpdate(const kodi::addon::PVRTimer& ti if (timer.GetTimerType() == TIMER_REPEATING_SERIESLINK) htsmsg_add_str(m, "serieslinkUri", timer.GetSeriesLink().c_str()); - /* Custom integer props. */ - m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomIntProperties(), m); + /* Custom props. */ + m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomProperties(), m); /* Send and Wait */ { @@ -478,6 +480,10 @@ bool AutoRecordings::ParseAutorecAddOrUpdate(htsmsg_t* msg, bool bAdd) if (str) rec.SetConfigUuid(str); + str = htsmsg_get_str(msg, "comment"); + if (str) + rec.SetComment(str); + return true; } diff --git a/src/tvheadend/AutoRecordings.h b/src/tvheadend/AutoRecordings.h index ce42e990..88a62abe 100644 --- a/src/tvheadend/AutoRecordings.h +++ b/src/tvheadend/AutoRecordings.h @@ -45,7 +45,7 @@ class AutoRecordings int GetAutorecTimerCount() const; void GetAutorecTimers(std::vector& timers); const unsigned int GetTimerIntIdFromStringId(const std::string& strId) const; - const std::vector GetCustomIntSettingDefinitions() const; + const std::vector GetCustomSettingDefinitions() const; /* client to server messages */ PVR_ERROR SendAutorecAdd(const kodi::addon::PVRTimer& timer); diff --git a/src/tvheadend/CustomTimerProperties.cpp b/src/tvheadend/CustomTimerProperties.cpp index 0275522e..9e7a27d3 100644 --- a/src/tvheadend/CustomTimerProperties.cpp +++ b/src/tvheadend/CustomTimerProperties.cpp @@ -28,10 +28,10 @@ CustomTimerProperties::CustomTimerProperties(const std::vector& pr { } -std::vector CustomTimerProperties::GetProperties( +std::vector CustomTimerProperties::GetProperties( const tvheadend::entity::Recording& rec) const { - std::vector customProps; + std::vector customProps; for (unsigned int propId : m_propIds) { switch (propId) @@ -47,6 +47,11 @@ std::vector CustomTimerProperties::GetPropertie } break; } + case CUSTOM_PROP_ID_DVR_COMMENT: + { + customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, rec.GetComment()); + break; + } default: Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId); break; @@ -55,10 +60,10 @@ std::vector CustomTimerProperties::GetPropertie return customProps; } -std::vector CustomTimerProperties::GetProperties( +std::vector CustomTimerProperties::GetProperties( const tvheadend::entity::AutoRecording& autorec) const { - std::vector customProps; + std::vector customProps; for (unsigned int propId : m_propIds) { switch (propId) @@ -82,6 +87,11 @@ std::vector CustomTimerProperties::GetPropertie } break; } + case CUSTOM_PROP_ID_DVR_COMMENT: + { + customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, autorec.GetComment()); + break; + } default: Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId); break; @@ -90,10 +100,10 @@ std::vector CustomTimerProperties::GetPropertie return customProps; } -std::vector CustomTimerProperties::GetProperties( +std::vector CustomTimerProperties::GetProperties( const tvheadend::entity::TimeRecording& timerec) const { - std::vector customProps; + std::vector customProps; for (unsigned int propId : m_propIds) { switch (propId) @@ -109,6 +119,11 @@ std::vector CustomTimerProperties::GetPropertie } break; } + case CUSTOM_PROP_ID_DVR_COMMENT: + { + customProps.emplace_back(CUSTOM_PROP_ID_DVR_COMMENT, timerec.GetComment()); + break; + } default: Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId); break; @@ -117,10 +132,10 @@ std::vector CustomTimerProperties::GetPropertie return customProps; } -const std::vector CustomTimerProperties:: - GetSettingDefinitions() const +const std::vector CustomTimerProperties::GetSettingDefinitions() + const { - std::vector ret; + std::vector ret; for (unsigned int propId : m_propIds) { @@ -162,6 +177,20 @@ const std::vector CustomTimerProperties:: } break; } + case CUSTOM_PROP_ID_DVR_COMMENT: + { + std::string defaultValue; + const std::vector 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; + } default: Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId); break; @@ -220,8 +249,27 @@ const std::vector CustomTimerProperties::GetPossib return {}; } +const std::vector CustomTimerProperties::GetPossibleValues( + unsigned int propId, std::string& defaultValue) const +{ + switch (propId) + { + case CUSTOM_PROP_ID_DVR_COMMENT: + { + // Simple string prop, no pre-defined values; default is empty string. + static const std::vector values{}; + defaultValue = ""; + return values; + } + default: + Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", propId); + break; + } + return {}; +} + void CustomTimerProperties::AppendPropertiesToHTSPMessage( - const std::vector& props, htsmsg_t* msg) const + const std::vector& props, htsmsg_t* msg) const { for (const auto& prop : props) { @@ -230,7 +278,7 @@ void CustomTimerProperties::AppendPropertiesToHTSPMessage( case CUSTOM_PROP_ID_AUTOREC_BROADCASTTYPE: { /* Broadcast type */ - htsmsg_add_u32(msg, "broadcastType", prop.GetValue()); + htsmsg_add_u32(msg, "broadcastType", prop.GetIntValue()); break; } case CUSTOM_PROP_ID_DVR_CONFIGURATION: @@ -238,7 +286,7 @@ void CustomTimerProperties::AppendPropertiesToHTSPMessage( /* DVR configuration */ for (const auto& config : m_dvrConfigs) { - if (config.GetId() == prop.GetValue()) + if (config.GetId() == prop.GetIntValue()) { htsmsg_add_str(msg, "configName", config.GetUuid().c_str()); break; @@ -246,6 +294,12 @@ void CustomTimerProperties::AppendPropertiesToHTSPMessage( } break; } + case CUSTOM_PROP_ID_DVR_COMMENT: + { + /* Broadcast type */ + htsmsg_add_str(msg, "comment", prop.GetStringValue().c_str()); + break; + } default: Logger::Log(LogLevel::LEVEL_ERROR, "Unknown property %u", prop.GetKey()); break; @@ -266,18 +320,44 @@ int CustomTimerProperties::GetDvrConfigurationId(const std::string& uuid) const return -1; } -kodi::addon::PVRIntSettingDefinition CustomTimerProperties::CreateSettingDefinition( +kodi::addon::PVRSettingDefinition CustomTimerProperties::CreateSettingDefinition( unsigned int settingId, int resourceId, const std::vector& values, int defaultValue, uint64_t readonlyConditions) const { - kodi::addon::PVRIntSettingDefinition settingDef; + kodi::addon::PVRSettingDefinition settingDef; + settingDef.SetId(settingId); + settingDef.SetName(kodi::addon::GetLocalizedString(resourceId)); + settingDef.SetType(PVR_SETTING_TYPE::INT); + settingDef.SetReadonlyConditions(readonlyConditions); + + kodi::addon::PVRIntSettingDefinition intSettingDef; + intSettingDef.SetValues(std::move(values)); + intSettingDef.SetDefaultValue(defaultValue); + + settingDef.SetIntDefinition(intSettingDef); + return settingDef; +} + +kodi::addon::PVRSettingDefinition CustomTimerProperties::CreateSettingDefinition( + unsigned int settingId, + int resourceId, + const std::vector& values, + const std::string& defaultValue, + uint64_t readonlyConditions) const +{ + kodi::addon::PVRSettingDefinition settingDef; settingDef.SetId(settingId); settingDef.SetName(kodi::addon::GetLocalizedString(resourceId)); - settingDef.SetValues(std::move(values)); - settingDef.SetDefaultValue(defaultValue); + settingDef.SetType(PVR_SETTING_TYPE::STRING); settingDef.SetReadonlyConditions(readonlyConditions); + + kodi::addon::PVRStringSettingDefinition stringSettingDef; + stringSettingDef.SetValues(std::move(values)); + stringSettingDef.SetDefaultValue(defaultValue); + + settingDef.SetStringDefinition(stringSettingDef); return settingDef; } diff --git a/src/tvheadend/CustomTimerProperties.h b/src/tvheadend/CustomTimerProperties.h index 5e7db26c..475c13ce 100644 --- a/src/tvheadend/CustomTimerProperties.h +++ b/src/tvheadend/CustomTimerProperties.h @@ -18,9 +18,10 @@ extern "C" namespace kodi::addon { -class PVRIntKeyValuePair; +class PVRSettingDefinition; +class PVRSettingKeyValuePair; class PVRTypeIntValue; -class PVRIntSettingDefinition; +class PVRTypeStringValue; } // namespace kodi::addon namespace tvheadend @@ -37,6 +38,7 @@ class TimeRecording; // custom property ids constexpr unsigned int CUSTOM_PROP_ID_AUTOREC_BROADCASTTYPE{1}; constexpr unsigned int CUSTOM_PROP_ID_DVR_CONFIGURATION{2}; +constexpr unsigned int CUSTOM_PROP_ID_DVR_COMMENT{3}; class CustomTimerProperties { @@ -47,33 +49,42 @@ class CustomTimerProperties virtual ~CustomTimerProperties() = default; // Custom props for all one-shot timers - std::vector GetProperties( + std::vector GetProperties( const tvheadend::entity::Recording& rec) const; // Custom props for Autorecs - std::vector GetProperties( + std::vector GetProperties( const tvheadend::entity::AutoRecording& autorec) const; // Custom props for Timerecs - std::vector GetProperties( + std::vector GetProperties( const tvheadend::entity::TimeRecording& timerec) const; // Setting definitions - const std::vector GetSettingDefinitions() const; + const std::vector GetSettingDefinitions() const; // Append given props to given HTSP message - void AppendPropertiesToHTSPMessage(const std::vector& props, + void AppendPropertiesToHTSPMessage(const std::vector& props, htsmsg_t* msg) const; private: const std::vector GetPossibleValues(unsigned int propId, int& defaultValue) const; - kodi::addon::PVRIntSettingDefinition CreateSettingDefinition( + const std::vector GetPossibleValues( + unsigned int propId, std::string& defaultValue) const; + kodi::addon::PVRSettingDefinition CreateSettingDefinition( unsigned int settingId, int resourceId, const std::vector& values, int defaultValue, uint64_t readonlyConditions) const; + kodi::addon::PVRSettingDefinition CreateSettingDefinition( + unsigned int settingId, + int resourceId, + const std::vector& values, + const std::string& defaultValue, + uint64_t readonlyConditions) const; + int GetDvrConfigurationId(const std::string& uuid) const; const std::vector m_propIds; diff --git a/src/tvheadend/TimeRecordings.cpp b/src/tvheadend/TimeRecordings.cpp index 25cbc191..4a2c23df 100644 --- a/src/tvheadend/TimeRecordings.cpp +++ b/src/tvheadend/TimeRecordings.cpp @@ -22,7 +22,7 @@ using namespace tvheadend::entity; using namespace tvheadend::utilities; TimeRecordings::TimeRecordings(HTSPConnection& conn, Profiles& dvrConfigs) - : m_conn(conn), m_customTimerProps({CUSTOM_PROP_ID_DVR_CONFIGURATION}, conn, dvrConfigs) + : m_conn(conn), m_customTimerProps({CUSTOM_PROP_ID_DVR_CONFIGURATION, CUSTOM_PROP_ID_DVR_COMMENT}, conn, dvrConfigs) { } @@ -83,8 +83,8 @@ void TimeRecordings::GetTimerecTimers(std::vector& timers tmr.SetFullTextEpgSearch(false); // n/a for manual timers tmr.SetParentClientIndex(0); - /* Custom integer props. */ - tmr.SetCustomIntProperties(m_customTimerProps.GetProperties(rec.second)); + /* Custom props. */ + tmr.SetCustomProperties(m_customTimerProps.GetProperties(rec.second)); timers.emplace_back(std::move(tmr)); } @@ -114,8 +114,8 @@ const std::string TimeRecordings::GetTimerStringIdFromIntId(unsigned int intId) return ""; } -const std::vector TimeRecordings:: - GetCustomIntSettingDefinitions() const +const std::vector TimeRecordings::GetCustomSettingDefinitions() + const { return m_customTimerProps.GetSettingDefinitions(); } @@ -175,8 +175,8 @@ PVR_ERROR TimeRecordings::SendTimerecAddOrUpdate(const kodi::addon::PVRTimer& ti if (timer.GetDirectory() != "/") htsmsg_add_str(m, "directory", timer.GetDirectory().c_str()); - /* Custom integer props. */ - m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomIntProperties(), m); + /* Custom props. */ + m_customTimerProps.AppendPropertiesToHTSPMessage(timer.GetCustomProperties(), m); /* Send and Wait */ { @@ -346,6 +346,10 @@ bool TimeRecordings::ParseTimerecAddOrUpdate(htsmsg_t* msg, bool bAdd) if (str) rec.SetConfigUuid(str); + str = htsmsg_get_str(msg, "comment"); + if (str) + rec.SetComment(str); + return true; } diff --git a/src/tvheadend/TimeRecordings.h b/src/tvheadend/TimeRecordings.h index b32c159d..8248385c 100644 --- a/src/tvheadend/TimeRecordings.h +++ b/src/tvheadend/TimeRecordings.h @@ -41,7 +41,7 @@ class TimeRecordings int GetTimerecTimerCount() const; void GetTimerecTimers(std::vector& timers); const unsigned int GetTimerIntIdFromStringId(const std::string& strId) const; - const std::vector GetCustomIntSettingDefinitions() const; + const std::vector GetCustomSettingDefinitions() const; /* client to server messages */ PVR_ERROR SendTimerecAdd(const kodi::addon::PVRTimer& timer); diff --git a/src/tvheadend/entity/RecordingBase.h b/src/tvheadend/entity/RecordingBase.h index a921e1c1..00e13b6f 100644 --- a/src/tvheadend/entity/RecordingBase.h +++ b/src/tvheadend/entity/RecordingBase.h @@ -26,7 +26,7 @@ class RecordingBase : public Entity return Entity::operator==(right) && m_enabled == right.m_enabled && m_lifetime == right.m_lifetime && m_priority == right.m_priority && m_title == right.m_title && m_channel == right.m_channel && - m_configUuid == right.m_configUuid; + m_configUuid == right.m_configUuid && m_comment == right.m_comment; } bool operator!=(const RecordingBase& right) { return !(*this == right); } @@ -50,6 +50,9 @@ class RecordingBase : public Entity const std::string& GetConfigUuid() const { return m_configUuid; } void SetConfigUuid(const std::string& uuid) { m_configUuid = uuid; } + const std::string& GetComment() const { return m_comment; } + void SetComment(const std::string& comment) { m_comment = comment; } + private: uint32_t m_enabled{0}; // If [time|auto]rec entry is enabled (activated). uint32_t m_lifetime{0}; // Lifetime (in days). @@ -57,6 +60,7 @@ class RecordingBase : public Entity std::string m_title; // Title (pattern) for the recording files. uint32_t m_channel{0}; // Channel ID. std::string m_configUuid; // DVR configuration UUID. + std::string m_comment; // user supplied comment }; } // namespace tvheadend::entity