From 8a6290e4239817fe8cf5d77edaa2332f40f22bdd Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 3 Aug 2021 11:23:12 +0200 Subject: [PATCH] do not download reading-list if only unread msgs are wanted, allow fetching icons on freshrss --- .../services/greader/greadernetwork.cpp | 15 ++++++++++----- .../services/greader/greaderserviceroot.cpp | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/librssguard/services/greader/greadernetwork.cpp b/src/librssguard/services/greader/greadernetwork.cpp index e90e5a8ce..e83d86ab1 100755 --- a/src/librssguard/services/greader/greadernetwork.cpp +++ b/src/librssguard/services/greader/greadernetwork.cpp @@ -164,8 +164,10 @@ void GreaderNetwork::prepareFeedFetching(GreaderServiceRoot* root, if (m_performGlobalFetching) { qWarningNN << LOGSEC_GREADER << "Performing global contents fetching."; - auto remote_all_ids_list = itemIds(GREADER_API_FULL_STATE_READING_LIST, false, proxy); - auto remote_unread_ids_list = itemIds(GREADER_API_FULL_STATE_READING_LIST, true, proxy); + QStringList remote_all_ids_list = m_downloadOnlyUnreadMessages + ? QStringList() + : itemIds(GREADER_API_FULL_STATE_READING_LIST, false, proxy); + QStringList remote_unread_ids_list = itemIds(GREADER_API_FULL_STATE_READING_LIST, true, proxy); for (int i = 0; i < remote_all_ids_list.size(); i++) { remote_all_ids_list.replace(i, convertShortStreamIdToLongStreamId(remote_all_ids_list.at(i))); @@ -227,8 +229,10 @@ QList GreaderNetwork::getMessagesIntelligently(ServiceRoot* root, // 2. Get read IDs for a feed. // 3. Download messages/contents for missing or changed IDs. // 4. Add prefetched starred msgs. - auto remote_all_ids_list = itemIds(stream_id, false, proxy); - auto remote_unread_ids_list = itemIds(stream_id, true, proxy); + QStringList remote_all_ids_list = m_downloadOnlyUnreadMessages + ? QStringList() + : itemIds(stream_id, false, proxy); + QStringList remote_unread_ids_list = itemIds(stream_id, true, proxy); // Convert item IDs to long form. for (int i = 0; i < remote_all_ids_list.size(); i++) { @@ -366,7 +370,8 @@ QList GreaderNetwork::itemContents(ServiceRoot* root, const QList my_stream_ids(stream_ids); while (!my_stream_ids.isEmpty()) { - int batch = m_service == GreaderServiceRoot::Service::TheOldReader + int batch = m_service == GreaderServiceRoot::Service::TheOldReader || + m_service == GreaderServiceRoot::Service::FreshRss ? TOR_ITEM_CONTENTS_BATCH : GREADER_API_ITEM_CONTENTS_BATCH; QList batch_ids = my_stream_ids.mid(0, batch); diff --git a/src/librssguard/services/greader/greaderserviceroot.cpp b/src/librssguard/services/greader/greaderserviceroot.cpp index 7b82ef394..c7fa913de 100755 --- a/src/librssguard/services/greader/greaderserviceroot.cpp +++ b/src/librssguard/services/greader/greaderserviceroot.cpp @@ -223,5 +223,5 @@ void GreaderServiceRoot::updateTitleIcon() { } RootItem* GreaderServiceRoot::obtainNewTreeForSyncIn() const { - return m_network->categoriesFeedsLabelsTree(network()->service() != Service::FreshRss, networkProxy()); + return m_network->categoriesFeedsLabelsTree(true, networkProxy()); }