Ejemplo n.º 1
0
bool CEpg::UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase /* = false */)
{
  bool bReturn = false;

  /* XXX tags aren't always fetched correctly here */
  CEpgInfoTag *InfoTag = (CEpgInfoTag *) this->InfoTag(tag.UniqueBroadcastID(), tag.Start());
  /* create a new tag if no tag with this ID exists */
  if (!InfoTag)
  {
    CSingleLock lock(m_critSection);
    InfoTag = CreateTag();
    InfoTag->SetUniqueBroadcastID(tag.UniqueBroadcastID());
    push_back(InfoTag);
  }

  InfoTag->m_Epg = this;
  InfoTag->Update(tag);

  Sort();

  if (bUpdateDatabase)
    bReturn = InfoTag->Persist();
  else
    bReturn = true;

  return bReturn;
}
Ejemplo n.º 2
0
bool CEpg::UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase /* = false */, bool bSort /* = true */)
{
  bool bReturn(false);
  CSingleLock lock(m_critSection);

  CEpgInfoTag *infoTag = GetTag(tag.UniqueBroadcastID(), tag.StartAsUTC());

  /* create a new tag if no tag with this ID exists */
  bool bNewTag(false);
  if (!infoTag)
  {
    infoTag = new CEpgInfoTag();
    infoTag->SetUniqueBroadcastID(tag.UniqueBroadcastID());
    push_back(infoTag);
    bNewTag = true;
  }

  infoTag->m_Epg = this;
  infoTag->Update(tag, bNewTag);

  if (bSort)
    Sort();

  if (bUpdateDatabase)
    bReturn = infoTag->Persist();
  else
    bReturn = true;

  return bReturn;
}
Ejemplo n.º 3
0
void CEpg::AddEntry(const CEpgInfoTag &tag)
{
  CEpgInfoTag *newTag = CreateTag();
  if (newTag)
  {
    push_back(newTag);

    newTag->m_Epg = this;
    newTag->Update(tag);
  }
}
Ejemplo n.º 4
0
void CEpg::AddEntry(const CEpgInfoTag &tag)
{
  CEpgInfoTag *newTag = new CEpgInfoTag();
  if (newTag)
  {
    push_back(newTag);

    newTag->m_Epg = this;
    newTag->Update(tag);
    newTag->m_bChanged = false;
  }
}