Skip image upload to Wikidata (nearby -> green pins) (#6349)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled

* Skip image upload to Wikidata if item already has image

* Re-run CI

* no more Failed to update Wikidata for green pins
This commit is contained in:
Sonal Yadav 2025-06-22 19:10:15 +05:30 committed by GitHub
parent ca5c7ec966
commit 09da7b8d68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 13 deletions

View file

@ -196,13 +196,16 @@ class WikidataEditService @Inject constructor(
return wikidataClient.setClaim(claim, COMMONS_APP_TAG).blockingSingle()
}
fun handleImageClaimResult(wikidataItem: WikidataItem, revisionId: Long?) {
fun handleImageClaimResult(wikidataItem: WikidataItem, revisionId: Long?, p18WasSkipped: Boolean = false) {
if (revisionId != null) {
wikidataEditListener?.onSuccessfulWikidataEdit()
showSuccessToast(wikidataItem.name)
} else {
} else if (!p18WasSkipped) {
Timber.d("Unable to make wiki data edit for entity %s", wikidataItem)
showLongToast(context, context.getString(R.string.wikidata_edit_failure))
} else {
Timber.d("Wikidata edit skipped for entity %s because P18 already exists", wikidataItem)
// No error shown to user, as this is not a failure
}
}