Skip to content

Commit 9ca9407

Browse files
committed
Checks if pic parameter of the wikidata item is empty or not. If not, it does not overrides the existing image, it is just a regular commons upload.
1 parent 048e519 commit 9ca9407

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/main/java/fr/free/nrw/commons/wikidata/WikidataEditService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ public class WikidataEditService {
4848
* @param wikidataEntityId
4949
* @param fileName
5050
*/
51-
public void createClaimWithLogging(String wikidataEntityId, String fileName) {
51+
public void createClaimWithLogging(String wikidataEntityId, String fileName, String p18Value) {
5252
if (wikidataEntityId == null) {
5353
Timber.d("Skipping creation of claim as Wikidata entity ID is null");
5454
return;
5555
}
5656

57+
if (!p18Value.trim().isEmpty()) {
58+
Timber.d("Skipping creation of claim as p18Value is not null, we won't override existing image");
59+
return;
60+
}
61+
5762
if (fileName == null) {
5863
Timber.d("Skipping creation of claim as fileName entity ID is null");
5964
return;

0 commit comments

Comments
 (0)