mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Skip image upload to Wikidata if item already has image
This commit is contained in:
parent
9eff9e8e82
commit
c1aead8b24
2 changed files with 6 additions and 10 deletions
|
|
@ -473,6 +473,8 @@ class UploadWorker(
|
||||||
if (!contribution.hasInvalidLocation()) {
|
if (!contribution.hasInvalidLocation()) {
|
||||||
var revisionID: Long? = null
|
var revisionID: Long? = null
|
||||||
try {
|
try {
|
||||||
|
// Only set P18 if the place does not already have a picture
|
||||||
|
if (wikiDataPlace.imageValue.isNullOrBlank()) {
|
||||||
revisionID =
|
revisionID =
|
||||||
wikidataEditService.createClaim(
|
wikidataEditService.createClaim(
|
||||||
wikiDataPlace,
|
wikiDataPlace,
|
||||||
|
|
@ -489,7 +491,11 @@ class UploadWorker(
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.blockingAwait()
|
.blockingAwait()
|
||||||
Timber.d("Updated WikiItem place ${place.name} with image ${place.pic}")
|
Timber.d("Updated WikiItem place ${place.name} with image ${place.pic}")
|
||||||
|
}
|
||||||
|
showSuccessNotification(contribution)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Place already has a picture, so skip setting P18 but still show success notification
|
||||||
showSuccessNotification(contribution)
|
showSuccessNotification(contribution)
|
||||||
}
|
}
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Authors:
|
|
||||||
* Vlad5250
|
|
||||||
-->
|
|
||||||
<resources>
|
|
||||||
<string name="crash_dialog_title">کامَنٕز گوو رُکِتھ</string>
|
|
||||||
<string name="crash_dialog_text">Oops. کیہہ تام گوو غلط!</string>
|
|
||||||
<string name="crash_dialog_comment_prompt">ؤنِیوٚ اَسہِ توٚہہِ کیاہ ٲسِیوٚ کران، تہٕ کٕریٚو تہِ اَسہِ سٕتی شیر بذریعہِ برقی خط. یُس مَدَتھ کَرِ اَسہِ اَتھ شہَرنَس منٛز!</string>
|
|
||||||
<string name="crash_dialog_ok_toast">شُکریہ!</string>
|
|
||||||
</resources>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue