mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Don't show uploads that have been deleted.
This commit is contained in:
parent
ac22525c69
commit
269cef559b
1 changed files with 6 additions and 1 deletions
|
|
@ -74,7 +74,7 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
|
||||||
MWApi.RequestBuilder builder = api.action("query")
|
MWApi.RequestBuilder builder = api.action("query")
|
||||||
.param("list", "logevents")
|
.param("list", "logevents")
|
||||||
.param("letype", "upload")
|
.param("letype", "upload")
|
||||||
.param("leprop", "title|timestamp")
|
.param("leprop", "title|timestamp|ids")
|
||||||
.param("leuser", user)
|
.param("leuser", user)
|
||||||
.param("lelimit", getLimit());
|
.param("lelimit", getLimit());
|
||||||
if(!TextUtils.isEmpty(lastModified)) {
|
if(!TextUtils.isEmpty(lastModified)) {
|
||||||
|
|
@ -97,6 +97,11 @@ public class ContributionsSyncAdapter extends AbstractThreadedSyncAdapter {
|
||||||
Timber.d("%d results!", uploads.size());
|
Timber.d("%d results!", uploads.size());
|
||||||
ArrayList<ContentValues> imageValues = new ArrayList<>();
|
ArrayList<ContentValues> imageValues = new ArrayList<>();
|
||||||
for(ApiResult image: uploads) {
|
for(ApiResult image: uploads) {
|
||||||
|
String pageId = image.getString("@pageid");
|
||||||
|
if (pageId.equals("0")) {
|
||||||
|
// means that this upload was deleted.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
String filename = image.getString("@title");
|
String filename = image.getString("@title");
|
||||||
if(fileExists(contentProviderClient, filename)) {
|
if(fileExists(contentProviderClient, filename)) {
|
||||||
Timber.d("Skipping %s", filename);
|
Timber.d("Skipping %s", filename);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue