本文整理汇总了C++中CPVREpgInfoTag::Writer方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVREpgInfoTag::Writer方法的具体用法?C++ CPVREpgInfoTag::Writer怎么用?C++ CPVREpgInfoTag::Writer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVREpgInfoTag
的用法示例。
在下文中一共展示了CPVREpgInfoTag::Writer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Persist
int CPVREpgDatabase::Persist(const CPVREpgInfoTag &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, sOriginalTitle, sCast, sDirector, sWriter, iYear, sIMDBNumber, "
"sIconPath, iGenreType, iGenreSubType, sGenre, iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iFlags, iBroadcastUid) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %i, '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i);",
tag.EpgID(), static_cast<unsigned int>(iStartTime), static_cast<unsigned int>(iEndTime),
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(),
tag.OriginalTitle(true).c_str(), tag.Cast().c_str(), tag.Director().c_str(), tag.Writer().c_str(), tag.Year(), tag.IMDBNumber().c_str(),
tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
static_cast<unsigned int>(iFirstAired), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNumber(), tag.EpisodeNumber(), tag.EpisodePart(), tag.EpisodeName().c_str(), tag.Flags(),
tag.UniqueBroadcastID());
}
else
{
strQuery = PrepareSQL("REPLACE INTO epgtags (idEpg, iStartTime, "
"iEndTime, sTitle, sPlotOutline, sPlot, sOriginalTitle, sCast, sDirector, sWriter, iYear, sIMDBNumber, "
"sIconPath, iGenreType, iGenreSubType, sGenre, iFirstAired, iParentalRating, iStarRating, bNotify, iSeriesId, "
"iEpisodeId, iEpisodePart, sEpisodeName, iFlags, iBroadcastUid, idBroadcast) "
"VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %i, '%s', '%s', %i, %i, '%s', %u, %i, %i, %i, %i, %i, %i, '%s', %i, %i, %i);",
tag.EpgID(), static_cast<unsigned int>(iStartTime), static_cast<unsigned int>(iEndTime),
tag.Title(true).c_str(), tag.PlotOutline(true).c_str(), tag.Plot(true).c_str(),
tag.OriginalTitle(true).c_str(), tag.Cast().c_str(), tag.Director().c_str(), tag.Writer().c_str(), tag.Year(), tag.IMDBNumber().c_str(),
tag.Icon().c_str(), tag.GenreType(), tag.GenreSubType(), strGenre.c_str(),
static_cast<unsigned int>(iFirstAired), tag.ParentalRating(), tag.StarRating(), tag.Notify(),
tag.SeriesNumber(), tag.EpisodeNumber(), tag.EpisodePart(), tag.EpisodeName().c_str(), tag.Flags(),
tag.UniqueBroadcastID(), iBroadcastId);
}
if (bSingleUpdate)
{
if (ExecuteQuery(strQuery))
iReturn = (int) m_pDS->lastinsertid();
}
else
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
return iReturn;
}