mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Make neccesary changes
This commit is contained in:
parent
34943542bf
commit
aa3eeb32be
3 changed files with 6 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package fr.free.nrw.commons.nearby.model
|
package fr.free.nrw.commons.nearby.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class ResultTuple {
|
class ResultTuple {
|
||||||
@SerializedName("xml:lang")
|
@SerializedName("xml:lang")
|
||||||
|
|
@ -15,7 +16,7 @@ class ResultTuple {
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
language = ""
|
language = Locale.getDefault().language
|
||||||
type = ""
|
type = ""
|
||||||
value = ""
|
value = ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ class UploadWorker(
|
||||||
return@onErrorReturn null
|
return@onErrorReturn null
|
||||||
}.blockingSingle()
|
}.blockingSingle()
|
||||||
|
|
||||||
if (null != uploadResult && uploadResult.isSuccessful()) {
|
if (uploadResult != null && uploadResult.isSuccessful()) {
|
||||||
Timber.d(
|
Timber.d(
|
||||||
"Stash Upload success..proceeding to make wikidata edit",
|
"Stash Upload success..proceeding to make wikidata edit",
|
||||||
)
|
)
|
||||||
|
|
@ -469,7 +469,7 @@ class UploadWorker(
|
||||||
contribution: Contribution,
|
contribution: Contribution,
|
||||||
) {
|
) {
|
||||||
val wikiDataPlace = contribution.wikidataPlace
|
val wikiDataPlace = contribution.wikidataPlace
|
||||||
if (wikiDataPlace != null && wikiDataPlace.imageValue == null) {
|
if (wikiDataPlace != null) {
|
||||||
if (!contribution.hasInvalidLocation()) {
|
if (!contribution.hasInvalidLocation()) {
|
||||||
var revisionID: Long? = null
|
var revisionID: Long? = null
|
||||||
try {
|
try {
|
||||||
|
|
@ -479,7 +479,7 @@ class UploadWorker(
|
||||||
uploadResult.filename,
|
uploadResult.filename,
|
||||||
contribution.media.captions,
|
contribution.media.captions,
|
||||||
)
|
)
|
||||||
if (null != revisionID) {
|
if (revisionID != null) {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
val place = placesRepository.fetchPlace(wikiDataPlace.id)
|
val place = placesRepository.fetchPlace(wikiDataPlace.id)
|
||||||
place.name = wikiDataPlace.name
|
place.name = wikiDataPlace.name
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,7 @@ class WikidataEditService @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
private fun captionEdits(contribution: Contribution, fileEntityId: Long): Observable<Boolean> {
|
private fun captionEdits(contribution: Contribution, fileEntityId: Long): Observable<Boolean> {
|
||||||
return Observable.fromIterable(contribution.media.captions.entries)
|
return Observable.fromIterable(contribution.media.captions.entries)
|
||||||
.concatMap { addCaption(fileEntityId, it.key, it.value) }
|
.concatMap { addCaption(fileEntityId, it.key, it.value) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue