Permalink
Browse files

[resume] CVideoDatabase::GetPlayCounts no longer overrides informatio…

…n set in the items, which we assume may be more up to date.
  • Loading branch information...
1 parent 13c0875 commit 10509a3fb3815f7a8fb7b5127e9776d173c4cddc @hippojay hippojay committed with Jonathan Marshall Jul 9, 2012
Showing with 7 additions and 3 deletions.
  1. +6 −3 xbmc/video/VideoDatabase.cpp
  2. +1 −0 xbmc/video/VideoDatabase.h
@@ -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();
}
@@ -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

0 comments on commit 10509a3

Please sign in to comment.