Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1455 from fetzerch/feature-pvr-recordingimages

[pvr] Added Icon, thumbnail and fanart support for recordings
  • Loading branch information...
commit d875510e44246ef74c150c37cb9dbbde77ec2ca0 2 parents dfb4679 + bced8b5
@opdenkamp opdenkamp authored
View
35 xbmc/addons/include/xbmc_pvr_types.h
@@ -72,10 +72,10 @@ struct DemuxPacket;
#define PVR_STREAM_MAX_STREAMS 20
/* current PVR API version */
-#define XBMC_PVR_API_VERSION "1.3.0"
+#define XBMC_PVR_API_VERSION "1.4.0"
/* min. PVR API version */
-#define XBMC_PVR_MIN_API_VERSION "1.3.0"
+#define XBMC_PVR_MIN_API_VERSION "1.4.0"
#ifdef __cplusplus
extern "C" {
@@ -251,20 +251,23 @@ extern "C" {
* @brief Representation of a recording.
*/
typedef struct PVR_RECORDING {
- char strRecordingId[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) unique id of the recording on the client. */
- char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) the title of this recording */
- char strStreamURL[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (required) stream URL to access this recording */
- char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) directory of this recording on the client */
- char strPlotOutline[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot outline */
- char strPlot[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot */
- char strChannelName[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (optional) channel name */
- time_t recordingTime; /*!< @brief (optional) start time of the recording */
- int iDuration; /*!< @brief (optional) duration of the recording in seconds */
- int iPriority; /*!< @brief (optional) priority of this recording (from 0 - 100) */
- int iLifetime; /*!< @brief (optional) life time in days of this recording */
- int iGenreType; /*!< @brief (optional) genre type */
- int iGenreSubType; /*!< @brief (optional) genre sub type */
- int iPlayCount; /*!< @brief (optional) play count of this recording on the client */
+ char strRecordingId[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) unique id of the recording on the client. */
+ char strTitle[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) the title of this recording */
+ char strStreamURL[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (required) stream URL to access this recording */
+ char strDirectory[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) directory of this recording on the client */
+ char strPlotOutline[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot outline */
+ char strPlot[PVR_ADDON_DESC_STRING_LENGTH]; /*!< @brief (optional) plot */
+ char strChannelName[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (optional) channel name */
+ char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) icon path */
+ char strThumbnailPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) thumbnail path */
+ char strFanartPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) fanart path */
+ time_t recordingTime; /*!< @brief (optional) start time of the recording */
+ int iDuration; /*!< @brief (optional) duration of the recording in seconds */
+ int iPriority; /*!< @brief (optional) priority of this recording (from 0 - 100) */
+ int iLifetime; /*!< @brief (optional) life time in days of this recording */
+ int iGenreType; /*!< @brief (optional) genre type */
+ int iGenreSubType; /*!< @brief (optional) genre sub type */
+ int iPlayCount; /*!< @brief (optional) play count of this recording on the client */
} ATTRIBUTE_PACKED PVR_RECORDING;
/*!
View
3  xbmc/pvr/addons/PVRClient.cpp
@@ -188,6 +188,9 @@ void CPVRClient::WriteClientRecordingInfo(const CPVRRecording &xbmcRecording, PV
addonRecording.iLifetime = xbmcRecording.m_iLifetime;
strncpy(addonRecording.strDirectory, xbmcRecording.m_strDirectory.c_str(), sizeof(addonRecording.strDirectory) - 1);
strncpy(addonRecording.strStreamURL, xbmcRecording.m_strStreamURL.c_str(), sizeof(addonRecording.strStreamURL) - 1);
+ strncpy(addonRecording.strIconPath, xbmcRecording.m_strIconPath.c_str(), sizeof(addonRecording.strIconPath) - 1);
+ strncpy(addonRecording.strThumbnailPath, xbmcRecording.m_strThumbnailPath.c_str(), sizeof(addonRecording.strThumbnailPath) - 1);
+ strncpy(addonRecording.strFanartPath, xbmcRecording.m_strFanartPath.c_str(), sizeof(addonRecording.strFanartPath) - 1);
}
/*!
View
70 xbmc/pvr/recordings/PVRRecording.cpp
@@ -39,20 +39,23 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING &recording, unsigned int iClien
{
Reset();
- m_strRecordingId = recording.strRecordingId;
- m_strTitle = recording.strTitle;
- m_iClientId = iClientId;
- m_recordingTime = recording.recordingTime + g_advancedSettings.m_iPVRTimeCorrection;
- m_duration = CDateTimeSpan(0, 0, recording.iDuration / 60, recording.iDuration % 60);
- m_iPriority = recording.iPriority;
- m_iLifetime = recording.iLifetime;
- m_strDirectory = recording.strDirectory;
- m_strPlot = recording.strPlot;
- m_strPlotOutline = recording.strPlotOutline;
- m_strStreamURL = recording.strStreamURL;
- m_strChannelName = recording.strChannelName;
- m_genre = StringUtils::Split(CEpg::ConvertGenreIdToString(recording.iGenreType, recording.iGenreSubType), g_advancedSettings.m_videoItemSeparator);
- m_iRecPlayCount = recording.iPlayCount;
+ m_strRecordingId = recording.strRecordingId;
+ m_strTitle = recording.strTitle;
+ m_iClientId = iClientId;
+ m_recordingTime = recording.recordingTime + g_advancedSettings.m_iPVRTimeCorrection;
+ m_duration = CDateTimeSpan(0, 0, recording.iDuration / 60, recording.iDuration % 60);
+ m_iPriority = recording.iPriority;
+ m_iLifetime = recording.iLifetime;
+ m_strDirectory = recording.strDirectory;
+ m_strPlot = recording.strPlot;
+ m_strPlotOutline = recording.strPlotOutline;
+ m_strStreamURL = recording.strStreamURL;
+ m_strChannelName = recording.strChannelName;
+ m_genre = StringUtils::Split(CEpg::ConvertGenreIdToString(recording.iGenreType, recording.iGenreSubType), g_advancedSettings.m_videoItemSeparator);
+ m_iRecPlayCount = recording.iPlayCount;
+ m_strIconPath = recording.strIconPath;
+ m_strThumbnailPath = recording.strThumbnailPath;
+ m_strFanartPath = recording.strFanartPath;
}
bool CPVRRecording::operator ==(const CPVRRecording& right) const
@@ -71,7 +74,10 @@ bool CPVRRecording::operator ==(const CPVRRecording& right) const
m_strDirectory == right.m_strDirectory &&
m_strFileNameAndPath == right.m_strFileNameAndPath &&
m_strTitle == right.m_strTitle &&
- m_iRecPlayCount == right.m_iRecPlayCount);
+ m_iRecPlayCount == right.m_iRecPlayCount &&
+ m_strIconPath == right.m_strIconPath &&
+ m_strThumbnailPath == right.m_strThumbnailPath &&
+ m_strFanartPath == right.m_strFanartPath);
}
bool CPVRRecording::operator !=(const CPVRRecording& right) const
@@ -90,6 +96,9 @@ void CPVRRecording::Reset(void)
m_iLifetime = -1;
m_strFileNameAndPath = StringUtils::EmptyString;
m_iRecPlayCount = 0;
+ m_strIconPath = StringUtils::EmptyString;
+ m_strThumbnailPath = StringUtils::EmptyString;
+ m_strFanartPath = StringUtils::EmptyString;
m_recordingTime.Reset();
CVideoInfoTag::Reset();
@@ -186,20 +195,23 @@ void CPVRRecording::DisplayError(PVR_ERROR err) const
void CPVRRecording::Update(const CPVRRecording &tag)
{
- m_strRecordingId = tag.m_strRecordingId;
- m_iClientId = tag.m_iClientId;
- m_strTitle = tag.m_strTitle;
- m_recordingTime = tag.m_recordingTime;
- m_duration = tag.m_duration;
- m_iPriority = tag.m_iPriority;
- m_iLifetime = tag.m_iLifetime;
- m_strDirectory = tag.m_strDirectory;
- m_strPlot = tag.m_strPlot;
- m_strPlotOutline = tag.m_strPlotOutline;
- m_strStreamURL = tag.m_strStreamURL;
- m_strChannelName = tag.m_strChannelName;
- m_genre = tag.m_genre;
- m_iRecPlayCount = tag.m_iRecPlayCount;
+ m_strRecordingId = tag.m_strRecordingId;
+ m_iClientId = tag.m_iClientId;
+ m_strTitle = tag.m_strTitle;
+ m_recordingTime = tag.m_recordingTime;
+ m_duration = tag.m_duration;
+ m_iPriority = tag.m_iPriority;
+ m_iLifetime = tag.m_iLifetime;
+ m_strDirectory = tag.m_strDirectory;
+ m_strPlot = tag.m_strPlot;
+ m_strPlotOutline = tag.m_strPlotOutline;
+ m_strStreamURL = tag.m_strStreamURL;
+ m_strChannelName = tag.m_strChannelName;
+ m_genre = tag.m_genre;
+ m_iRecPlayCount = tag.m_iRecPlayCount;
+ m_strIconPath = tag.m_strIconPath;
+ m_strThumbnailPath = tag.m_strThumbnailPath;
+ m_strFanartPath = tag.m_strFanartPath;
CStdString strShow;
strShow.Format("%s - ", g_localizeStrings.Get(20364).c_str());
View
21 xbmc/pvr/recordings/PVRRecording.h
@@ -44,15 +44,18 @@ namespace PVR
class CPVRRecording : public CVideoInfoTag
{
public:
- int m_iClientId; /*!< ID of the backend */
- CStdString m_strRecordingId; /*!< unique id of the recording on the client */
- CStdString m_strChannelName; /*!< name of the channel this was recorded from */
- CDateTimeSpan m_duration; /*!< duration of this recording */
- int m_iPriority; /*!< priority of this recording */
- int m_iLifetime; /*!< lifetime of this recording */
- CStdString m_strStreamURL; /*!< stream URL. if empty use pvr client */
- CStdString m_strDirectory; /*!< directory of this recording on the client */
- int m_iRecPlayCount; /*!< play count of this recording on the client */
+ int m_iClientId; /*!< ID of the backend */
+ CStdString m_strRecordingId; /*!< unique id of the recording on the client */
+ CStdString m_strChannelName; /*!< name of the channel this was recorded from */
+ CDateTimeSpan m_duration; /*!< duration of this recording */
+ int m_iPriority; /*!< priority of this recording */
+ int m_iLifetime; /*!< lifetime of this recording */
+ CStdString m_strStreamURL; /*!< stream URL. if empty use pvr client */
+ CStdString m_strDirectory; /*!< directory of this recording on the client */
+ int m_iRecPlayCount; /*!< play count of this recording on the client */
+ CStdString m_strIconPath; /*!< icon path */
+ CStdString m_strThumbnailPath; /*!< thumbnail path */
+ CStdString m_strFanartPath; /*!< fanart path */
CPVRRecording(void);
CPVRRecording(const PVR_RECORDING &recording, unsigned int iClientId);
View
9 xbmc/pvr/recordings/PVRRecordings.cpp
@@ -108,6 +108,15 @@ void CPVRRecordings::GetContents(const CStdString &strDirectory, CFileItemList *
pFileItem->m_dateTime = current->RecordingTimeAsLocalTime();
pFileItem->SetPath(current->m_strFileNameAndPath);
+ if (!current->m_strIconPath.IsEmpty())
+ pFileItem->SetIconImage(current->m_strIconPath);
+
+ if (!current->m_strThumbnailPath.IsEmpty())
+ pFileItem->SetThumbnailImage(current->m_strThumbnailPath);
+
+ if (!current->m_strFanartPath.IsEmpty())
+ pFileItem->SetProperty("Fanart_Image", current->m_strFanartPath);
+
// Set the play count either directly from client (if supported) or from video db
if (g_PVRClients->SupportsRecordingPlayCount(pFileItem->GetPVRRecordingInfoTag()->m_iClientId))
{
Please sign in to comment.
Something went wrong with that request. Please try again.