bool CEpg::Load(void) { bool bReturn(false); CEpgDatabase *database = g_EpgContainer.GetDatabase(); if (!database || !database->IsOpen()) { CLog::Log(LOGERROR, "EPG - %s - could not open the database", __FUNCTION__); return bReturn; } CSingleLock lock(m_critSection); int iEntriesLoaded = database->Get(*this); if (iEntriesLoaded <= 0) { CLog::Log(LOGDEBUG, "EPG - %s - no database entries found for table '%s'.", __FUNCTION__, m_strName.c_str()); } else { m_lastScanTime = GetLastScanTime(); #if EPG_DEBUGGING CLog::Log(LOGDEBUG, "EPG - %s - %d entries loaded for table '%s'.", __FUNCTION__, (int) m_tags.size(), m_strName.c_str()); #endif bReturn = true; } m_bLoaded = true; return bReturn; }
bool CEpg::Load(void) { bool bReturn = false; CSingleLock lock(m_critSection); CEpgDatabase *database = g_EpgContainer.GetDatabase(); if (!database || !database->Open()) { CLog::Log(LOGERROR, "Epg - %s - could not open the database", __FUNCTION__); return bReturn; } int iEntriesLoaded = database->Get(this); if (iEntriesLoaded <= 0) { CLog::Log(LOGNOTICE, "Epg - %s - no database entries found for table '%s'.", __FUNCTION__, m_strName.c_str()); } else { CLog::Log(LOGDEBUG, "Epg - %s - %d entries loaded for table '%s'.", __FUNCTION__, size(), m_strName.c_str()); Sort(); bReturn = true; } database->Close(); return bReturn; }