From 10509a3fb3815f7a8fb7b5127e9776d173c4cddc Mon Sep 17 00:00:00 2001 From: hippojay Date: Mon, 9 Jul 2012 21:08:19 +0100 Subject: [PATCH] [resume] CVideoDatabase::GetPlayCounts no longer overrides information set in the items, which we assume may be more up to date. --- xbmc/video/VideoDatabase.cpp | 9 ++++++--- xbmc/video/VideoDatabase.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 7b0309505..f2b7c56fc 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -4130,9 +4130,12 @@ bool CVideoDatabase::GetPlayCounts(const CStdString &strPath, CFileItemList &ite if (item) { item->GetVideoInfoTag()->m_playCount = m_pDS->fv(1).get_asInt(); - item->GetVideoInfoTag()->m_resumePoint.timeInSeconds = m_pDS->fv(2).get_asInt(); - item->GetVideoInfoTag()->m_resumePoint.totalTimeInSeconds = m_pDS->fv(3).get_asInt(); - item->GetVideoInfoTag()->m_resumePoint.type = CBookmark::RESUME; + if (!item->GetVideoInfoTag()->m_resumePoint.IsSet()) + { + item->GetVideoInfoTag()->m_resumePoint.timeInSeconds = m_pDS->fv(2).get_asInt(); + item->GetVideoInfoTag()->m_resumePoint.totalTimeInSeconds = m_pDS->fv(3).get_asInt(); + item->GetVideoInfoTag()->m_resumePoint.type = CBookmark::RESUME; + } } m_pDS->next(); } diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 9cb16e0ad..f5a62b444 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -402,6 +402,7 @@ class CVideoDatabase : public CDatabase void UpdateLastPlayed(const CFileItem &item); /*! \brief Get the playcount and resume point of a list of items + Note that if the resume point is already set on an item, it won't be overridden. \param path the path to fetch videos from \param items CFileItemList to fetch the playcounts for \sa GetPlayCount, SetPlayCount, IncrementPlayCount