mirror of https://github.com/readrops/Readrops.git
Set max number of fetched items to 5000
This commit is contained in:
parent
aa3a3d3150
commit
d85ddf0e70
|
@ -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) {
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue