bool CPVRDatabase::UpdateLastWatched(const CPVRChannelGroup &group) { std::string strQuery = PrepareSQL("UPDATE channelgroups SET iLastWatched = %d WHERE idGroup = %d", group.LastWatched(), group.GroupID()); return ExecuteQuery(strQuery); }
bool CPVRChannelGroups::UpdateGroupsEntries(const CPVRChannelGroups &groups) { CSingleLock lock(m_critSection); /* go through groups list and check for deleted groups */ for (int iGroupPtr = size() - 1; iGroupPtr >= 0; iGroupPtr--) { CPVRChannelGroup existingGroup(*at(iGroupPtr)); if (!existingGroup.IsInternalGroup()) { CPVRChannelGroup *group = (CPVRChannelGroup *) groups.GetByName(existingGroup.GroupName()); if (group == NULL) { CLog::Log(LOGDEBUG, "PVRChannelGroups - %s - user defined group %s with ID '%u' does not exist on the client anymore. deleting", __FUNCTION__, existingGroup.GroupName().c_str(), existingGroup.GroupID()); DeleteGroup(*at(iGroupPtr)); } } } /* go through the groups list and check for new groups */ for (unsigned int iGroupPtr = 0; iGroupPtr < groups.size(); iGroupPtr++) { CPVRChannelGroup *group = groups.at(iGroupPtr); /* check if this group is present in this container */ CPVRChannelGroup *existingGroup = (CPVRChannelGroup *) GetByName(group->GroupName()); if (existingGroup == NULL) { CPVRChannelGroup *newGroup = new CPVRChannelGroup(m_bRadio); newGroup->SetGroupName(group->GroupName()); push_back(newGroup); } } return true; }
bool CPVRDatabase::PersistGroupMembers(CPVRChannelGroup &group) { bool bReturn = false; bool bRemoveChannels = false; CStdString strQuery; CSingleLock lock(group.m_critSection); if (group.size() > 0) { for (unsigned int iChannelPtr = 0; iChannelPtr < group.size(); iChannelPtr++) { PVRChannelGroupMember member = group.at(iChannelPtr); CStdString strWhereClause = FormatSQL("idChannel = %u AND idGroup = %u AND iChannelNumber = %u", member.channel->ChannelID(), group.GroupID(), member.iChannelNumber); CStdString strValue = GetSingleValue("map_channelgroups_channels", "idChannel", strWhereClause); if (strValue.IsEmpty()) { strQuery = FormatSQL("REPLACE INTO map_channelgroups_channels (" "idGroup, idChannel, iChannelNumber) " "VALUES (%i, %i, %i);", group.GroupID(), member.channel->ChannelID(), member.iChannelNumber); QueueInsertQuery(strQuery); } } lock.Leave(); bReturn = CommitInsertQueries(); bRemoveChannels = RemoveStaleChannelsFromGroup(group); } return bReturn && bRemoveChannels; }
void CAddonCallbacksPVR::PVRTransferChannelGroupMember(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member) { if (!handle) { CLog::Log(LOGERROR, "PVR - %s - invalid handler data", __FUNCTION__); return; } CPVRClient *client = GetPVRClient(addonData); CPVRChannelGroup *group = static_cast<CPVRChannelGroup *>(handle->dataAddress); if (!member || !client || !group) { CLog::Log(LOGERROR, "PVR - %s - invalid handler data", __FUNCTION__); return; } CPVRChannelPtr channel = g_PVRChannelGroups->GetByUniqueID(member->iChannelUniqueId, client->GetID()); if (!channel) { CLog::Log(LOGERROR, "PVR - %s - cannot find group '%s' or channel '%d'", __FUNCTION__, member->strGroupName, member->iChannelUniqueId); } else if (group->IsRadio() == channel->IsRadio()) { /* transfer this entry to the group */ group->AddToGroup(*channel, member->iChannelNumber); } }
int CPVREpgContainer::GetEPGNext(CFileItemList* results, bool bRadio) { CPVRChannelGroup *channels = (CPVRChannelGroup *) CPVRManager::GetChannelGroups()->GetGroupAll(bRadio); CSingleLock lock(m_critSection); int iInitialSize = results->Size(); for (unsigned int iChannelPtr = 0; iChannelPtr < channels->Size(); iChannelPtr++) { CPVRChannel *channel = (CPVRChannel *) channels->GetByIndex(iChannelPtr); CPVREpg *epg = channel->GetEPG(); if (!epg->HasValidEntries()) continue; const CPVREpgInfoTag *epgNext = (CPVREpgInfoTag *) epg->InfoTagNext(); if (!epgNext) continue; CFileItemPtr entry(new CFileItem(*epgNext)); entry->SetLabel2(epgNext->Start().GetAsLocalizedTime("", false)); entry->m_strPath = channel->ChannelName(); entry->SetThumbnailImage(channel->IconPath()); results->Add(entry); } return results->Size() - iInitialSize; }
bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group, const std::vector<int> &channelsToDelete) { bool bDelete(true); unsigned int iDeletedChannels(0); /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } while (iDeletedChannels < channelsToDelete.size()) { std::string strChannelsToDelete; for (unsigned int iChannelPtr = 0; iChannelPtr + iDeletedChannels < channelsToDelete.size() && iChannelPtr < 50; iChannelPtr++) strChannelsToDelete += StringUtils::Format(", %d", channelsToDelete.at(iDeletedChannels + iChannelPtr)); if (!strChannelsToDelete.empty()) { strChannelsToDelete.erase(0, 2); Filter filter; filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID())); filter.AppendWhere(PrepareSQL("idChannel IN (%s)", strChannelsToDelete.c_str())); bDelete = DeleteValues("map_channelgroups_channels", filter) && bDelete; } iDeletedChannels += 50; } return bDelete; }
bool CPVRDatabase::PersistGroupMembers(const CPVRChannelGroup &group) { bool bReturn = true; bool bRemoveChannels = true; std::string strQuery; CSingleLock lock(group.m_critSection); if (group.HasChannels()) { for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = group.m_sortedMembers.begin(); it != group.m_sortedMembers.end(); ++it) { std::string strWhereClause = PrepareSQL("idChannel = %u AND idGroup = %u AND iChannelNumber = %u AND iSubChannelNumber = %u", (*it).channel->ChannelID(), group.GroupID(), (*it).iChannelNumber, (*it).iSubChannelNumber); std::string strValue = GetSingleValue("map_channelgroups_channels", "idChannel", strWhereClause); if (strValue.empty()) { strQuery = PrepareSQL("REPLACE INTO map_channelgroups_channels (" "idGroup, idChannel, iChannelNumber, iSubChannelNumber) " "VALUES (%i, %i, %i, %i);", group.GroupID(), (*it).channel->ChannelID(), (*it).iChannelNumber, (*it).iSubChannelNumber); QueueInsertQuery(strQuery); } } lock.Leave(); bReturn = CommitInsertQueries(); bRemoveChannels = RemoveStaleChannelsFromGroup(group); } return bReturn && bRemoveChannels; }
bool CPVRChannelGroup::AddAndUpdateChannels(const CPVRChannelGroup &channels, bool bUseBackendChannelNumbers) { bool bReturn(false); CSingleLock lock(m_critSection); /* go through the channel list and check for new channels. channels will only by updated in CPVRChannelGroupInternal to prevent dupe updates */ for (unsigned int iChannelPtr = 0; iChannelPtr < channels.size(); iChannelPtr++) { PVRChannelGroupMember member = channels.at(iChannelPtr); if (!member.channel) continue; /* check whether this channel is known in the internal group */ CPVRChannel *existingChannel = (CPVRChannel *) g_PVRChannelGroups->GetGroupAll(m_bRadio)->GetByClient(member.channel->UniqueID(), member.channel->ClientID()); if (!existingChannel) continue; /* if it's found, add the channel to this group */ if (!IsGroupMember(*existingChannel)) { int iChannelNumber = bUseBackendChannelNumbers ? member.channel->ClientChannelNumber() : 0; AddToGroup(*existingChannel, iChannelNumber, false); bReturn = true; CLog::Log(LOGINFO,"PVRChannelGroup - %s - added %s channel '%s' at position %d in group '%s'", __FUNCTION__, m_bRadio ? "radio" : "TV", existingChannel->ChannelName().c_str(), iChannelNumber, GroupName().c_str()); } } return bReturn; }
bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group) { // don't delete internal groups if (group.IsInternalGroup()) { CLog::Log(LOGERROR, "PVR - %s - cannot delete internal group '%s'", __FUNCTION__, group.GroupName().c_str()); return false; } // delete the group in this container CSingleLock lock(m_critSection); for (std::vector<CPVRChannelGroupPtr>::iterator it = m_groups.begin(); it != m_groups.end(); it++) { if ((*it)->GroupID() == group.GroupID()) { // update the selected group in the gui if it's deleted CPVRChannelGroupPtr selectedGroup = GetSelectedGroup(); if (selectedGroup && *selectedGroup == group) g_PVRManager.SetPlayingGroup(GetGroupAll()); m_groups.erase(it); break; } } // delete the group from the database CPVRDatabase *database = GetPVRDatabase(); return database ? database->Delete(group) : false; }
/*! * @brief Copy over group info from xbmcGroup to addonGroup. * @param xbmcGroup The group on XBMC's side. * @param addonGroup The group on the addon's side. */ void CPVRClient::WriteClientGroupInfo(const CPVRChannelGroup &xbmcGroup, PVR_CHANNEL_GROUP &addonGroup) { memset(&addonGroup, 0, sizeof(addonGroup)); addonGroup.bIsRadio = xbmcGroup.IsRadio(); strncpy(addonGroup.strGroupName, xbmcGroup.GroupName().c_str(), sizeof(addonGroup.strGroupName) - 1); }
bool CPVRManager::IsSelectedGroup(const CPVRChannelGroup &group) const { CSingleLock lock(m_critSection); return (group.IsRadio() && m_currentRadioGroup && *m_currentRadioGroup == group) || (!group.IsRadio() && m_currentTVGroup && *m_currentTVGroup == group); }
bool CPVRDatabase::UpdateLastWatched(const CPVRChannelGroup &group) { CSingleLock lock(m_critSection); const std::string strQuery = PrepareSQL("UPDATE channelgroups SET iLastWatched = %u WHERE idGroup = %d", static_cast<unsigned int>(group.LastWatched()), group.GroupID()); return ExecuteQuery(strQuery); }
bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group, const vector<int> &channelsToDelete) { bool bDelete(true); unsigned int iDeletedChannels(0); /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } while (iDeletedChannels < channelsToDelete.size()) { CStdString strChannelsToDelete; CStdString strWhereClause; for (unsigned int iChannelPtr = 0; iChannelPtr + iDeletedChannels < channelsToDelete.size() && iChannelPtr < 50; iChannelPtr++) strChannelsToDelete.AppendFormat(", %d", channelsToDelete.at(iDeletedChannels + iChannelPtr)); if (!strChannelsToDelete.IsEmpty()) { strChannelsToDelete = strChannelsToDelete.Right(strChannelsToDelete.length() - 2); strWhereClause = FormatSQL("idGroup = %u AND idChannel IN (%s)", group.GroupID(), strChannelsToDelete.c_str()); bDelete = DeleteValues("map_channelgroups_channels", strWhereClause) && bDelete; } iDeletedChannels += 50; } return bDelete; }
bool CPVRDatabase::PersistGroupMembers(const CPVRChannelGroup &group) { bool bReturn = true; bool bRemoveChannels = true; std::string strQuery; CSingleLock lock(group.m_critSection); if (group.HasChannels()) { for (const auto& groupMember : group.m_sortedMembers) { const std::string strWhereClause = PrepareSQL("idChannel = %u AND idGroup = %u AND iChannelNumber = %u AND iSubChannelNumber = %u", groupMember.channel->ChannelID(), group.GroupID(), groupMember.channelNumber.GetChannelNumber(), groupMember.channelNumber.GetSubChannelNumber()); const std::string strValue = GetSingleValue("map_channelgroups_channels", "idChannel", strWhereClause); if (strValue.empty()) { strQuery = PrepareSQL("REPLACE INTO map_channelgroups_channels (" "idGroup, idChannel, iChannelNumber, iSubChannelNumber) " "VALUES (%i, %i, %i, %i);", group.GroupID(), groupMember.channel->ChannelID(), groupMember.channelNumber.GetChannelNumber(), groupMember.channelNumber.GetSubChannelNumber()); QueueInsertQuery(strQuery); } } bReturn = CommitInsertQueries(); bRemoveChannels = RemoveStaleChannelsFromGroup(group); } return bReturn && bRemoveChannels; }
bool CPVRDatabase::GetCurrentGroupMembers(const CPVRChannelGroup &group, vector<int> &members) { bool bReturn(false); /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } CStdString strCurrentMembersQuery = PrepareSQL("SELECT idChannel FROM map_channelgroups_channels WHERE idGroup = %u", group.GroupID()); if (ResultQuery(strCurrentMembersQuery)) { try { while (!m_pDS->eof()) { members.push_back(m_pDS->fv("idChannel").get_asInt()); m_pDS->next(); } m_pDS->close(); bReturn = true; } catch (...) { CLog::Log(LOGERROR, "PVR - %s - couldn't load channels from the database", __FUNCTION__); } } else { CLog::Log(LOGERROR, "PVR - %s - query failed", __FUNCTION__); } return bReturn; }
bool CPVRChannels::GetGroupsDirectory(const CStdString &strBase, CFileItemList *results, bool bRadio) { CPVRChannels * channels = bRadio ? &PVRChannelsRadio : &PVRChannelsTV; CPVRChannelGroups *channelGroups = bRadio ? &PVRChannelGroupsRadio : &PVRChannelGroupsTV; CFileItemPtr item; item.reset(new CFileItem(strBase + "/all/", true)); item->SetLabel(g_localizeStrings.Get(593)); item->SetLabelPreformated(true); results->Add(item); /* container has hidden channels */ if (channels->GetNumHiddenChannels() > 0) { item.reset(new CFileItem(strBase + "/.hidden/", true)); item->SetLabel(g_localizeStrings.Get(19022)); item->SetLabelPreformated(true); results->Add(item); } /* add all groups */ for (unsigned int ptr = 0; ptr < channelGroups->size(); ptr++) { CPVRChannelGroup group = channelGroups->at(ptr); CStdString strGroup = strBase + "/" + group.GroupName() + "/"; item.reset(new CFileItem(strGroup, true)); item->SetLabel(group.GroupName()); item->SetLabelPreformated(true); results->Add(item); } return true; }
bool CPVRChannelGroups::UpdateFromClient(const CPVRChannelGroup &group) { CPVRChannelGroup *newGroup = new CPVRChannelGroup(group.IsRadio(), -1, group.GroupName()); push_back(newGroup); return true; }
bool CPVRDatabase::GetChannelGroupList(CPVRChannelGroups &results, bool bRadio /* = false */) { bool bReturn = false; CStdString strQuery = FormatSQL("SELECT * from ChannelGroup WHERE IsRadio = %u ORDER BY sortOrder\n", bRadio); int iNumRows = ResultQuery(strQuery); if (iNumRows > 0) { try { while (!m_pDS->eof()) { CPVRChannelGroup data; data.SetGroupID(m_pDS->fv("GroupId").get_asInt()); data.SetGroupName(m_pDS->fv("Name").get_asString()); data.SetSortOrder(m_pDS->fv("SortOrder").get_asInt()); results.push_back(data); m_pDS->next(); } bReturn = true; } catch (...) { CLog::Log(LOGERROR, "%s - couldn't load channels from the database", __FUNCTION__); } } m_pDS->close(); return bReturn; }
bool CPVRDatabase::RemoveStaleChannelsFromGroup(const CPVRChannelGroup &group) { bool bDelete(true); if (!group.IsInternalGroup()) { /* First remove channels that don't exist in the main channels table */ CStdString strWhereClause = FormatSQL("idChannel IN (SELECT map_channelgroups_channels.idChannel FROM map_channelgroups_channels LEFT JOIN channels on map_channelgroups_channels.idChannel = channels.idChannel WHERE channels.idChannel IS NULL)"); bDelete = DeleteValues("map_channelgroups_channels", strWhereClause); } if (group.size() > 0) { vector<int> currentMembers; if (GetCurrentGroupMembers(group, currentMembers)) { vector<int> channelsToDelete; for (unsigned int iChannelPtr = 0; iChannelPtr < currentMembers.size(); iChannelPtr++) { if (!group.IsGroupMember(currentMembers.at(iChannelPtr))) channelsToDelete.push_back(currentMembers.at(iChannelPtr)); } bDelete = DeleteChannelsFromGroup(group, channelsToDelete) && bDelete; } } else { CStdString strWhereClause = FormatSQL("idGroup = %u", group.GroupID()); bDelete = DeleteValues("map_channelgroups_channels", strWhereClause) && bDelete; } return bDelete; }
int CPVRDatabase::Get(CPVRChannelGroup &group) { int iReturn = -1; /* invalid group id */ if (group.GroupID() < 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return -1; } std::string strQuery = PrepareSQL("SELECT idChannel, iChannelNumber FROM map_channelgroups_channels WHERE idGroup = %u ORDER BY iChannelNumber", group.GroupID()); if (ResultQuery(strQuery)) { iReturn = 0; try { while (!m_pDS->eof()) { int iChannelId = m_pDS->fv("idChannel").get_asInt(); int iChannelNumber = m_pDS->fv("iChannelNumber").get_asInt(); CPVRChannelPtr channel = g_PVRChannelGroups->GetGroupAll(group.IsRadio())->GetByChannelID(iChannelId); if (channel) { #if PVRDB_DEBUGGING CLog::Log(LOGDEBUG, "PVR - %s - channel '%s' loaded from the database", __FUNCTION__, channel->m_strChannelName.c_str()); #endif PVRChannelGroupMember newMember = { channel, (unsigned int)iChannelNumber }; group.m_sortedMembers.push_back(newMember); group.m_members.insert(std::make_pair(channel->StorageId(), newMember)); iReturn++; } else { // remove a channel that doesn't exist (anymore) from the table Filter filter; filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID())); filter.AppendWhere(PrepareSQL("idChannel = %u", iChannelId)); DeleteValues("map_channelgroups_channels", filter); } m_pDS->next(); } m_pDS->close(); } catch(...) { CLog::Log(LOGERROR, "PVR - %s - failed to get channels", __FUNCTION__); } } if (iReturn > 0) group.SortByChannelNumber(); return iReturn; }
bool CPVRChannelGroups::UpdateFromClient(const CPVRChannelGroup &group) { CSingleLock lock(m_critSection); CPVRChannelGroup *newGroup = new CPVRChannelGroup(group.IsRadio(), 0, group.GroupName()); push_back(newGroup); return true; }
void CPVRChannelGroups::RemoveFromAllGroups(CPVRChannel *channel) { /* start at position 2 because channels are only deleted from non-system groups. system groups are entries 0 and 1 */ for (unsigned int iGroupPtr = 2; iGroupPtr < size(); iGroupPtr++) { CPVRChannelGroup *group = (CPVRChannelGroup *) at(iGroupPtr); group->RemoveFromGroup(*channel); } }
bool CPVRChannelGroups::Update(const CPVRChannelGroup &group, bool bSaveInDb) { CSingleLock lock(m_critSection); int iIndex = -1; /* try to find the group by id */ if (group.GroupID() > 0) iIndex = GetIndexForGroupID(group.GroupID()); /* try to find the group by name if we didn't find it yet */ if (iIndex < 0) iIndex = GetIndexForGroupName(group.GroupName()); if (iIndex < 0) { CPVRChannelGroup *newGroup = new CPVRChannelGroup(m_bRadio, group.GroupID(), group.GroupName()); if (bSaveInDb) newGroup->Persist(); push_back(newGroup); } else { at(iIndex)->SetGroupID(group.GroupID()); at(iIndex)->SetGroupName(group.GroupName()); if (bSaveInDb) at(iIndex)->Persist(); } return true; }
bool CPVRDatabase::RemoveStaleChannelsFromGroup(const CPVRChannelGroup &group) { bool bDelete(true); /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } if (!group.IsInternalGroup()) { /* First remove channels that don't exist in the main channels table */ // XXX work around for frodo: fix this up so it uses one query for all db types // mysql doesn't support subqueries when deleting and sqlite doesn't support joins when deleting if (g_advancedSettings.m_databaseTV.type.Equals("mysql")) { CStdString strQuery = PrepareSQL("DELETE m FROM map_channelgroups_channels m LEFT JOIN channels c ON (c.idChannel = m.idChannel) WHERE c.idChannel IS NULL"); bDelete = ExecuteQuery(strQuery); } else { Filter filter; filter.AppendWhere("idChannel IN (SELECT m.idChannel FROM map_channelgroups_channels m LEFT JOIN channels on m.idChannel = channels.idChannel WHERE channels.idChannel IS NULL)"); bDelete = DeleteValues("map_channelgroups_channels", filter); } } if (group.m_members.size() > 0) { vector<int> currentMembers; if (GetCurrentGroupMembers(group, currentMembers)) { vector<int> channelsToDelete; for (unsigned int iChannelPtr = 0; iChannelPtr < currentMembers.size(); iChannelPtr++) { if (!group.IsGroupMember(currentMembers.at(iChannelPtr))) channelsToDelete.push_back(currentMembers.at(iChannelPtr)); } bDelete = DeleteChannelsFromGroup(group, channelsToDelete) && bDelete; } } else { Filter filter; filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID())); bDelete = DeleteValues("map_channelgroups_channels", filter) && bDelete; } return bDelete; }
bool CPVRChannelGroups::AddChannelToGroup(CPVRChannel *channel, int iGroupId) { bool bReturn = false; CPVRChannelGroup *group = (CPVRChannelGroup *) GetById(iGroupId); if (group) { bReturn = group->AddToGroup(*channel); } return bReturn; }
bool CPVRChannelGroup::Update(const CPVRChannelGroup &group) { CSingleLock lock(m_critSection); if (!m_strGroupName.Equals(group.GroupName()) || m_iSortOrder != group.SortOrder()) { m_bChanged = true; m_strGroupName = group.GroupName(); m_iSortOrder = group.SortOrder(); } return true; }
bool CPVRChannelGroups::AddChannelToGroup(CPVRChannel *channel, int iGroupId) { bool bReturn = false; CSingleLock lock(m_critSection); CPVRChannelGroup *group = (CPVRChannelGroup *) GetById(iGroupId); if (group) { bReturn = group->AddToGroup(*channel); } return bReturn; }
bool CPVRDatabase::Delete(const CPVRChannelGroup &group) { /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVRDB - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } CStdString strWhereClause = FormatSQL("idGroup = %u AND bIsRadio = %u", group.GroupID(), group.IsRadio()); return DeleteValues("channelgroups", strWhereClause); }
CPVRChannelGroup::CPVRChannelGroup(const CPVRChannelGroup &group) { m_bRadio = group.m_bRadio; m_iGroupId = group.m_iGroupId; m_strGroupName = group.m_strGroupName; m_bLoaded = group.m_bLoaded; m_bChanged = group.m_bChanged; m_bUsingBackendChannelOrder = group.m_bUsingBackendChannelOrder; m_bUsingBackendChannelNumbers = group.m_bUsingBackendChannelNumbers; for (int iPtr = 0; iPtr < group.Size(); iPtr++) push_back(group.at(iPtr)); }
bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group) { /* invalid group id */ if (group.GroupID() <= 0) { CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); return false; } Filter filter; filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID())); return DeleteValues("map_channelgroups_channels", filter); }