Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1926 from axmhari/pvr-watched-fix

[pvr] Use play count and resume point information from the PVR client if available.
  • Loading branch information...
commit 7899597011184774b41059f5066d963e4c769216 2 parents 3041d7a + 1449141
@jmarshallnz jmarshallnz authored
View
3  xbmc/FileItem.cpp
@@ -1448,6 +1448,9 @@ void CFileItem::UpdateInfo(const CFileItem &item, bool replaceLabels /*=true*/)
if (item.HasVideoInfoTag())
{ // copy info across (TODO: premiered info is normally stored in m_dateTime by the db)
*GetVideoInfoTag() = *item.GetVideoInfoTag();
+ // preferably use some information from PVR info tag if available
+ if (HasPVRRecordingInfoTag())
+ GetPVRRecordingInfoTag()->CopyClientInfo(GetVideoInfoTag());
SetOverlayImage(ICON_OVERLAY_UNWATCHED, GetVideoInfoTag()->m_playCount > 0);
}
if (item.HasMusicInfoTag())
View
11 xbmc/pvr/recordings/PVRRecording.cpp
@@ -274,3 +274,14 @@ CStdString CPVRRecording::GetTitleFromURL(const CStdString &url)
}
return StringUtils::EmptyString;
}
+
+void CPVRRecording::CopyClientInfo(CVideoInfoTag *target)
+{
+ if (!target)
+ return;
+
+ if (g_PVRClients->SupportsRecordingPlayCount(m_iClientId))
+ target->m_playCount = m_playCount;
+ if (g_PVRClients->SupportsLastPlayedPosition(m_iClientId))
+ target->m_resumePoint = m_resumePoint;
+}
View
6 xbmc/pvr/recordings/PVRRecording.h
@@ -132,6 +132,12 @@ namespace PVR
*/
static CStdString GetTitleFromURL(const CStdString &url);
+ /*!
+ * @brief Copy some information from the client to the given video info tag
+ * @param target video info tag to which the information will be copied
+ */
+ void CopyClientInfo(CVideoInfoTag *target);
+
private:
CDateTime m_recordingTime; /*!< start time of the recording */
View
5 xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -53,6 +53,7 @@
#include "guilib/GUIKeyboardFactory.h"
#include "video/VideoInfoScanner.h"
#include "video/dialogs/GUIDialogVideoInfo.h"
+#include "pvr/recordings/PVRRecording.h"
using namespace XFILE;
using namespace VIDEODATABASEDIRECTORY;
@@ -469,6 +470,10 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items, CVideoDatabase &dat
fetchedPlayCounts = true;
}
+ // preferably use some information from PVR info tag if available
+ if (pItem->HasPVRRecordingInfoTag())
+ pItem->GetPVRRecordingInfoTag()->CopyClientInfo(pItem->GetVideoInfoTag());
+
// set the watched overlay
if (pItem->IsVideo())
pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, pItem->HasVideoInfoTag() && pItem->GetVideoInfoTag()->m_playCount > 0);
Please sign in to comment.
Something went wrong with that request. Please try again.