4
4
import android .os .Parcel ;
5
5
import android .os .Parcelable ;
6
6
7
+ import androidx .annotation .NonNull ;
8
+ import androidx .annotation .Nullable ;
9
+
7
10
import org .apache .commons .lang3 .StringUtils ;
8
11
import org .wikipedia .dataclient .mwapi .MwQueryPage ;
9
12
import org .wikipedia .gallery .ExtMetadata ;
20
23
import java .util .Locale ;
21
24
import java .util .Map ;
22
25
23
- import androidx .annotation .NonNull ;
24
- import androidx .annotation .Nullable ;
25
26
import fr .free .nrw .commons .location .LatLng ;
26
27
import fr .free .nrw .commons .utils .CommonsDateUtil ;
27
28
import fr .free .nrw .commons .utils .MediaDataExtractorUtil ;
@@ -156,9 +157,9 @@ public static Media from(MwQueryPage page) {
156
157
page .title (),
157
158
"" ,
158
159
0 ,
159
- safeParseDate (metadata .dateTimeOriginal (). value ()),
160
- safeParseDate (metadata .dateTime (). value () ),
161
- StringUtil .fromHtml (metadata .artist (). value () ).toString ()
160
+ safeParseDate (metadata .dateTime ()),
161
+ safeParseDate (metadata .dateTime ()),
162
+ StringUtil .fromHtml (metadata .artist ()).toString ()
162
163
);
163
164
164
165
if (!StringUtils .isBlank (imageInfo .getThumbUrl ())) {
@@ -170,17 +171,17 @@ public static Media from(MwQueryPage page) {
170
171
language = "default" ;
171
172
}
172
173
173
- media .setDescriptions (Collections .singletonMap (language , metadata .imageDescription (). value () ));
174
- media .setCategories (MediaDataExtractorUtil .extractCategoriesFromList (metadata .categories (). value ()));
175
- String latitude = metadata .gpsLatitude (). value ();
176
- String longitude = metadata .gpsLongitude (). value ();
174
+ media .setDescriptions (Collections .singletonMap (language , metadata .imageDescription ()));
175
+ media .setCategories (MediaDataExtractorUtil .extractCategoriesFromList (metadata .getCategories ()));
176
+ String latitude = metadata .getGpsLatitude ();
177
+ String longitude = metadata .getGpsLongitude ();
177
178
178
179
if (!StringUtils .isBlank (latitude ) && !StringUtils .isBlank (longitude )) {
179
180
LatLng latLng = new LatLng (Double .parseDouble (latitude ), Double .parseDouble (longitude ), 0 );
180
181
media .setCoordinates (latLng );
181
182
}
182
183
183
- media .setLicenseInformation (metadata .licenseShortName (). value () , metadata .licenseUrl (). value ());
184
+ media .setLicenseInformation (metadata .licenseShortName (), metadata .licenseUrl ());
184
185
return media ;
185
186
}
186
187
0 commit comments