bool CPVRChannel::SetLastWatched(time_t iLastWatched) { { CSingleLock lock(m_critSection); if (m_iLastWatched != iLastWatched) m_iLastWatched = iLastWatched; } const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase()); if (database) return database->UpdateLastWatched(*this); return false; }
bool CPVRChannelGroup::SetLastWatched(time_t iLastWatched) { const CPVRDatabasePtr database(CServiceBroker::GetPVRManager().GetTVDatabase()); CSingleLock lock(m_critSection); if (m_iLastWatched != iLastWatched) { m_iLastWatched = iLastWatched; /* update the database immediately */ if (database) return database->UpdateLastWatched(*this); } return false; }
bool CPVRChannel::SetLastWatched(time_t iLastWatched) { { CSingleLock lock(m_critSection); if (m_iLastWatched != iLastWatched) { m_iLastWatched = iLastWatched; const std::shared_ptr<CPVREpg> epg = GetEPG(); if (epg) epg->GetChannelData()->SetLastWatched(iLastWatched); } } const CPVRDatabasePtr database = CServiceBroker::GetPVRManager().GetTVDatabase(); if (database) return database->UpdateLastWatched(*this); return false; }