Permalink
Browse files

[PVR] let CPVRRecording implement ISerializable

  • Loading branch information...
Montellese committed Feb 20, 2014
1 parent a0cedfa commit 0a03d5c8f75872743f8574b1d978bf08f9b3fb1a
Showing with 24 additions and 0 deletions.
  1. +22 −0 xbmc/pvr/recordings/PVRRecording.cpp
  2. +2 −0 xbmc/pvr/recordings/PVRRecording.h
@@ -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;
@@ -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.
*/

0 comments on commit 0a03d5c

Please sign in to comment.