File tree 1 file changed +7
-0
lines changed
src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/workers
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 20
20
import org .openstreetmap .josm .plugins .mapillary .data .mapillary .MapillarySequence ;
21
21
import org .openstreetmap .josm .plugins .mapillary .gui .layer .MapillaryLayer ;
22
22
import org .openstreetmap .josm .plugins .mapillary .utils .MapillaryImageUtils ;
23
+ import org .openstreetmap .josm .spi .preferences .Config ;
23
24
import org .openstreetmap .josm .tools .JosmRuntimeException ;
24
25
import org .openstreetmap .josm .tools .Logging ;
25
26
import org .openstreetmap .josm .tools .Pair ;
@@ -121,7 +122,13 @@ protected MapillarySequence doInBackground() {
121
122
}
122
123
123
124
private void getImageRange (int i , long [] imagesToGet , long [] images ) {
125
+ int retries = 0 ;
124
126
Map <String , List <MapillaryNode >> map = MapillaryDownloader .downloadImages (imagesToGet );
127
+ while (retries < Config .getPref ().getInt ("mapillary.image.retries" , 10 ) && (map .size () != 1
128
+ || !map .containsKey (this .sequenceKey ) || map .get (this .sequenceKey ).size () != imagesToGet .length )) {
129
+ map = MapillaryDownloader .downloadImages (imagesToGet );
130
+ retries ++;
131
+ }
125
132
if (map .size () != 1 || !map .containsKey (this .sequenceKey )) {
126
133
throw new IllegalArgumentException (
127
134
"Mapillary sequence " + this .sequenceKey + " did not download any images" );
You can’t perform that action at this time.
0 commit comments