aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/pvr/recordings/PVRRecording.cpp22
-rw-r--r--xbmc/pvr/recordings/PVRRecording.h2
2 files changed, 24 insertions, 0 deletions
diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp
index 1c3fb97d54..c821f7399d 100644
--- a/xbmc/pvr/recordings/PVRRecording.cpp
+++ b/xbmc/pvr/recordings/PVRRecording.cpp
@@ -90,6 +90,28 @@ bool CPVRRecording::operator !=(const CPVRRecording& right) const
return !(*this == right);
}
+void CPVRRecording::Serialize(CVariant& value) const
+{
+ CVideoInfoTag::Serialize(value);
+
+ value["channel"] = m_strChannelName;
+ value["runtime"] = m_duration.GetSecondsTotal();
+ value["lifetime"] = m_iLifetime;
+ value["streamurl"] = m_strStreamURL;
+ value["directory"] = m_strDirectory;
+ value["icon"] = m_strIconPath;
+ value["starttime"] = m_recordingTime.IsValid() ? m_recordingTime.GetAsDBDateTime() : "";
+ value["endtime"] = m_recordingTime.IsValid() ? (m_recordingTime + m_duration).GetAsDBDateTime() : "";
+ value["recordingid"] = m_iRecordingId;
+
+ if (!value.isMember("art"))
+ value["art"] = CVariant(CVariant::VariantTypeObject);
+ if (!m_strThumbnailPath.empty())
+ value["art"]["thumb"] = m_strThumbnailPath;
+ if (!m_strFanartPath.empty())
+ value["art"]["fanart"] = m_strFanartPath;
+}
+
void CPVRRecording::Reset(void)
{
m_strRecordingId = StringUtils::EmptyString;
diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h
index 8238bf414e..dfa28a8a89 100644
--- a/xbmc/pvr/recordings/PVRRecording.h
+++ b/xbmc/pvr/recordings/PVRRecording.h
@@ -64,6 +64,8 @@ namespace PVR
bool operator ==(const CPVRRecording& right) const;
bool operator !=(const CPVRRecording& right) const;
+ virtual void Serialize(CVariant& value) const;
+
/*!
* @brief Reset this tag to it's initial state.
*/