return InternalError;
if (playcount != infos.m_playCount || lastPlayed != infos.m_lastPlayed)
- videodatabase.SetPlayCount(CFileItem(infos), infos.m_playCount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ {
+ // restore original playcount or the new one won't be announced
+ int newPlaycount = infos.m_playCount;
+ infos.m_playCount = playcount;
+ videodatabase.SetPlayCount(CFileItem(infos), newPlaycount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ }
return ACK;
}
return InternalError;
if (playcount != infos.m_playCount || lastPlayed != infos.m_lastPlayed)
- videodatabase.SetPlayCount(CFileItem(infos), infos.m_playCount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ {
+ // restore original playcount or the new one won't be announced
+ int newPlaycount = infos.m_playCount;
+ infos.m_playCount = playcount;
+ videodatabase.SetPlayCount(CFileItem(infos), newPlaycount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ }
return ACK;
}
return InternalError;
if (playcount != infos.m_playCount || lastPlayed != infos.m_lastPlayed)
- videodatabase.SetPlayCount(CFileItem(infos), infos.m_playCount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ {
+ // restore original playcount or the new one won't be announced
+ int newPlaycount = infos.m_playCount;
+ infos.m_playCount = playcount;
+ videodatabase.SetPlayCount(CFileItem(infos), newPlaycount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ }
return ACK;
}
return InternalError;
if (playcount != infos.m_playCount || lastPlayed != infos.m_lastPlayed)
- videodatabase.SetPlayCount(CFileItem(infos), infos.m_playCount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ {
+ // restore original playcount or the new one won't be announced
+ int newPlaycount = infos.m_playCount;
+ infos.m_playCount = playcount;
+ videodatabase.SetPlayCount(CFileItem(infos), newPlaycount, infos.m_lastPlayed.IsValid() ? infos.m_lastPlayed : CDateTime::GetCurrentDateTime());
+ }
return ACK;
}