5161: Fix repeating images in peer review (#5170)

* fix API call to fetch the latest changes

* add database table to keep a track of reviewed and skipped images

* fix repeating reviewed or skipped images

* add removed newline again

* add necessary comments

* change from timber.e to timber.i in case there is no exception

* reintroduce the parameter rctag in the API URL

* modify API URL to retrieve latest uploads

* remove unused imports and code

* modify ReviewHelperTest and add new unit tests

* modify tests in ReviewHelperTest.kt

* add comments about the value of gcmlimit
This commit is contained in:
Ritika Pahwa 2023-03-15 03:45:24 +05:30 committed by GitHub
parent c920ef0371
commit be1946cd7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 268 additions and 98 deletions

View file

@ -35,7 +35,6 @@ public class MwQueryResult extends BaseModel implements PostProcessingTypeAdapte
@Nullable private NotificationList notifications;
@Nullable private Map<String, Notification.UnreadNotificationWikiItem> unreadnotificationpages;
@SerializedName("general") @Nullable private SiteInfo generalSiteInfo;
@Nullable private List<RecentChange> recentchanges;
@SerializedName("wikimediaeditortaskscounts") @Nullable private EditorTaskCounts editorTaskCounts;
@SerializedName("allimages") @Nullable private List<ImageDetails> allImages;
@SerializedName("geosearch") @Nullable private List<GeoSearchItem> geoSearch;
@ -103,10 +102,6 @@ public class MwQueryResult extends BaseModel implements PostProcessingTypeAdapte
return captchaId;
}
@Nullable public List<RecentChange> getRecentChanges() {
return recentchanges;
}
@Nullable public ListUserResponse getUserResponse(@NonNull String userName) {
if (users != null) {
for (ListUserResponse user : users) {

View file

@ -1,42 +0,0 @@
package org.wikipedia.dataclient.mwapi;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.lang3.StringUtils;
@SuppressWarnings("unused")
public class RecentChange {
@Nullable private String type;
@Nullable private String title;
private long pageid;
private long revid;
@SerializedName("old_revid") private long oldRevisionId;
@Nullable private String timestamp;
@NonNull public String getType() {
return StringUtils.defaultString(type);
}
@NonNull public String getTitle() {
return StringUtils.defaultString(title);
}
public long getPageId() {
return pageid;
}
public long getRevId() {
return revid;
}
public long getOldRevisionId() {
return oldRevisionId;
}
public String getTimestamp() {
return StringUtils.defaultString(timestamp);
}
}