mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-08 07:57:28 +00:00
close #971
This commit is contained in:
parent
d569e718a9
commit
917e4f3fbd
@ -1094,7 +1094,6 @@ public final class ResponseBodyUtils {
|
||||
final List<MediaCandidate> sortedCandidates = candidates.stream()
|
||||
.sorted((c1, c2) -> Integer.compare(c2.getWidth(), c1.getWidth()))
|
||||
.collect(Collectors.toList());
|
||||
if (sortedCandidates.size() == 1) return sortedCandidates.get(0).getUrl();
|
||||
final List<MediaCandidate> filteredCandidates = sortedCandidates.stream()
|
||||
.filter(c ->
|
||||
c.getWidth() <= media.getOriginalWidth()
|
||||
@ -1102,6 +1101,7 @@ public final class ResponseBodyUtils {
|
||||
&& (isSquare || Integer.compare(c.getWidth(), c.getHeight()) != 0)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
if (filteredCandidates.size() == 0) return sortedCandidates.get(0).getUrl();
|
||||
final MediaCandidate candidate = filteredCandidates.get(0);
|
||||
if (candidate == null) return null;
|
||||
return candidate.getUrl();
|
||||
|
Loading…
Reference in New Issue
Block a user