updatedChannels.clear();
updatedChannels.squeeze();
- if (!Database::instance().getConnection().transaction())
- qWarning() << "Transaction failed" << __PRETTY_FUNCTION__;
-
processNextChannel();
}
void ChannelAggregator::finish() {
currentChannel = 0;
- QSqlDatabase db = Database::instance().getConnection();
- if (!db.commit()) qWarning() << "Commit failed" << __PRETTY_FUNCTION__;
-
#ifdef Q_OS_MAC
if (newVideoCount > 0 && unwatchedCount > 0 && mac::canNotify()) {
QString channelNames;
if (!videos.isEmpty()) {
YTChannel *channel = YTChannel::forId(videos.at(0)->getChannelId());
- channel->updateNotifyCount();
- emit channelChanged(channel);
+ if (channel) {
+ channel->updateNotifyCount();
+ emit channelChanged(channel);
+ }
updateUnwatchedCount();
for (Video *video : videos)
video->deleteLater();
if (!success) qWarning() << query.lastQuery() << query.lastError().text();
if (query.numRowsAffected() > 0) {
YTChannel *channel = YTChannel::forId(video->getChannelId());
- channel->updateNotifyCount();
+ if (channel) channel->updateNotifyCount();
}
}