mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Skip image upload to Wikidata (nearby -> green pins) (#6349)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
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:
parent
ca5c7ec966
commit
09da7b8d68
3 changed files with 12 additions and 13 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue