multiple improvements in distant channel search and general display of distant search results

This commit is contained in:
csoler 2020-06-25 21:15:37 +02:00
parent 500f572b98
commit ba486a0029
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
11 changed files with 47 additions and 27 deletions

View file

@ -538,23 +538,20 @@ void GxsChannelPostsWidgetWithModel::updateGroupData()
RsThread::async([this]()
{
RsGxsChannelGroup group;
std::vector<RsGxsChannelGroup> groups;
if(!rsGxsChannels->getChannelsInfo(std::list<RsGxsGroupId>{ groupId() }, groups))
if(rsGxsChannels->getChannelsInfo(std::list<RsGxsGroupId>{ groupId() }, groups) && groups.size()==1)
group = groups[0];
else if(!rsGxsChannels->getDistantSearchResultGroupData(groupId(),group))
{
std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value for channel: " << groupId() << std::endl;
std::cerr << __PRETTY_FUNCTION__ << " failed to get group data for channel: " << groupId() << std::endl;
return;
}
if(groups.size() != 1)
{
RsErr() << __PRETTY_FUNCTION__ << " cannot retrieve channel data for group ID " << groupId() << ": ERROR." << std::endl;
return;
}
RsQThreadUtils::postToObject( [this,groups]()
RsQThreadUtils::postToObject( [this,group]()
{
mGroup = groups[0];
mGroup = group;
mChannelPostsModel->updateChannel(groupId());
insertChannelDetails(mGroup);