mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
parent
0b25730a18
commit
3b7b6f91a2
4 changed files with 26 additions and 40 deletions
|
|
@ -42,6 +42,10 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||
private static final ContentValues[] EMPTY = {};
|
||||
private static int COMMIT_THRESHOLD = 10;
|
||||
|
||||
// Arbitrary limit to cap the number of contributions to ever load. This is a maximum built
|
||||
// into the app, rather than the user's setting. Also see Github issue #52.
|
||||
public static final int ABSOLUTE_CONTRIBUTIONS_LOAD_LIMIT = 500;
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Inject MediaWikiApi mwApi;
|
||||
@Inject
|
||||
|
|
@ -52,13 +56,6 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||
super(context, autoInitialize);
|
||||
}
|
||||
|
||||
private int getLimit() {
|
||||
|
||||
int limit = 500;
|
||||
Timber.d("Max number of uploads set to %d", limit);
|
||||
return limit; // FIXME: Parameterize!
|
||||
}
|
||||
|
||||
private boolean fileExists(ContentProviderClient client, String filename) {
|
||||
if (filename == null) {
|
||||
return false;
|
||||
|
|
@ -100,7 +97,7 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||
while (!done) {
|
||||
|
||||
try {
|
||||
result = mwApi.logEvents(user, lastModified, queryContinue, getLimit());
|
||||
result = mwApi.logEvents(user, lastModified, queryContinue, ABSOLUTE_CONTRIBUTIONS_LOAD_LIMIT);
|
||||
} catch (IOException e) {
|
||||
// There isn't really much we can do, eh?
|
||||
// FIXME: Perhaps add EventLogging?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue