本文整理汇总了C++中CEpgInfoTag::BroadcastId方法的典型用法代码示例。如果您正苦于以下问题:C++ CEpgInfoTag::BroadcastId方法的具体用法?C++ CEpgInfoTag::BroadcastId怎么用?C++ CEpgInfoTag::BroadcastId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEpgInfoTag
的用法示例。
在下文中一共展示了CEpgInfoTag::BroadcastId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Delete
bool CEpgDatabase::Delete(const CEpgInfoTag &tag)
{
/* tag without a database ID was not peristed */
if (tag.BroadcastId() <= 0)
{
return false;
}
CStdString strWhereClause = FormatSQL("idBroadcast = %u", tag.BroadcastId());
return DeleteValues("epgtags", strWhereClause);
}
示例2: Delete
bool CEpgDatabase::Delete(const CEpgInfoTag &tag)
{
/* tag without a database ID was not persisted */
if (tag.BroadcastId() <= 0)
return false;
Filter filter;
filter.AppendWhere(PrepareSQL("idBroadcast = %u", tag.BroadcastId()));
return DeleteValues("epgtags", filter);
}
示例3: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */, bool bLastUpdate /* = false */)
{
int iReturn = -1;
const CEpg *epg = tag.GetTable();
if (!epg || epg->EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title().c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iEpgId = epg->EpgID();
int iBroadcastId = tag.BroadcastId();
if (iBroadcastId <= 0)
{
CStdString strWhereClause;
if (tag.UniqueBroadcastID() > 0)
{
strWhereClause = FormatSQL("(iBroadcastUid = '%u' OR iStartTime = %u) AND idEpg = %u",
tag.UniqueBroadcastID(), iStartTime, iEpgId);
}
else
{
strWhereClause = FormatSQL("iStartTime = %u AND idEpg = '%u'",
iStartTime, iEpgId);
}
CStdString strValue = GetSingleValue("epgtags", "idBroadcast", strWhereClause);
if (!strValue.IsEmpty())
iBroadcastId = atoi(strValue);
}
CStdString strQuery;
if (iBroadcastId < 0)
{
strQuery = FormatSQL("INSERT INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID());
}
else
{
strQuery = FormatSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(),
tag.FirstAiredAsUTC().GetAsDBDateTime().c_str(), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId);
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
if (bLastUpdate)
CommitInsertQueries();
iReturn = 0;
}
return iReturn;
}
示例4: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */)
{
int iReturn(-1);
if (tag.EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title(true).c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iBroadcastId = tag.BroadcastId();
std::string strQuery;
/* Only store the genre string when needed */
std::string strGenre = (tag.GenreType() == EPG_GENRE_USE_STRING) ? StringUtils::Join(tag.Genre(), g_advancedSettings.m_videoItemSeparator) : "";
if (iBroadcastId < 0)
{
strQuery = PrepareSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, sIconPath, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, sRecordingId) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, '%s');",
tag.EpgID(), iStartTime, iEndTime,
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(), tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), tag.RecordingId().c_str());
}
else
{
strQuery = PrepareSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, sIconPath, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast, sRecordingId) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i, '%s');",
tag.EpgID(), iStartTime, iEndTime,
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(), tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId, tag.RecordingId().c_str());
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
return iReturn;
}
示例5: Persist
int CEpgDatabase::Persist(const CEpgInfoTag &tag, bool bSingleUpdate /* = true */)
{
int iReturn(-1);
const CEpg *epg = tag.GetTable();
if (!epg || epg->EpgID() <= 0)
{
CLog::Log(LOGERROR, "%s - tag '%s' does not have a valid table", __FUNCTION__, tag.Title().c_str());
return iReturn;
}
time_t iStartTime, iEndTime, iFirstAired;
tag.StartAsUTC().GetAsTime(iStartTime);
tag.EndAsUTC().GetAsTime(iEndTime);
tag.FirstAiredAsUTC().GetAsTime(iFirstAired);
int iEpgId = epg->EpgID();
if (bSingleUpdate)
{
Delete(*tag.GetTable(), iStartTime, iEndTime);
}
int iBroadcastId = tag.BroadcastId();
CSingleLock lock(m_critSection);
CStdString strQuery;
/* Only store the genre string when needed */
CStdString strGenre = (tag.GenreType() == EPG_GENRE_USE_STRING) ? tag.Genre() : "";
if (iBroadcastId < 0)
{
strQuery = FormatSQL("INSERT INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID());
}
else
{
strQuery = FormatSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, iGenreType, iGenreSubType, sGenre, "
"iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iBroadcastUid, idBroadcast) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
iEpgId, iStartTime, iEndTime,
tag.Title().c_str(), tag.PlotOutline().c_str(), tag.Plot().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
iFirstAired, tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNum(), tag.EpisodeNum(), tag.EpisodePart(), tag.EpisodeName().c_str(),
tag.UniqueBroadcastID(), iBroadcastId);
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
return iReturn;
}