Set max number of fetched items to 5000

This commit is contained in:
Shinokuni 2019-11-24 16:58:52 +01:00
parent aa3a3d3150
commit d85ddf0e70
3 changed files with 5 additions and 3 deletions

View File

@ -15,6 +15,8 @@ import retrofit2.converter.gson.GsonConverterFactory;
*/
public abstract class API<T> {
protected static final int MAX_ITEMS = 5000;
protected T api;
public API(Credentials credentials, @NonNull Class<T> clazz, @NonNull String endPoint) {

View File

@ -95,9 +95,9 @@ public class FreshRSSAPI extends API<FreshRSSService> {
switch (syncType) {
case INITIAL_SYNC:
return getItems(GOOGLE_READ, 10000, null);
return getItems(GOOGLE_READ, MAX_ITEMS, null);
case CLASSIC_SYNC:
return getItems(GOOGLE_READ, 10000, syncData.getLastModified());
return getItems(GOOGLE_READ, MAX_ITEMS, syncData.getLastModified());
}
return Single.error(new Exception("Unknown sync type"));

View File

@ -78,7 +78,7 @@ public class NextNewsAPI extends API<NextNewsService> {
private void initialSync(NextNewsSyncResult syncResult) throws IOException {
getFeedsAndFolders(syncResult);
Response<NextNewsItems> itemsResponse = api.getItems(3, false, -1).execute();
Response<NextNewsItems> itemsResponse = api.getItems(3, false, MAX_ITEMS).execute();
NextNewsItems itemList = itemsResponse.body();
if (!itemsResponse.isSuccessful())