Skip to content

Commit

Permalink
fix DW to always have normal url, fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
codingPF committed Nov 18, 2023
1 parent a301a50 commit 2d6eb39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,15 @@ private Optional<Map<Resolution, FilmUrl>> getVideos(
LOG.error("Malformed video url for video: {}", videoid);
}
});

if (videoListe.size() > 0 && !videoListe.containsKey(Resolution.NORMAL)) {
if (videoListe.containsKey(Resolution.SMALL)) {
videoListe.put(Resolution.NORMAL, videoListe.get(Resolution.SMALL));
videoListe.remove(Resolution.SMALL);
} else {
videoListe.put(Resolution.NORMAL, videoListe.get(Resolution.HD));
videoListe.remove(Resolution.HD);
}
}
if (videoListe.size() > 0) {
return Optional.of(videoListe);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ private void addUrls(final Map<Resolution, String> aVideoUrls, final Film aFilm,
LOG.error(String.format("A found download URL \"%s\" isn't valid.", value), ex);
}
});
// we are not ready to have pure audiodescription entries
if (aFilm.getUrls().size() == 0 && aFilm.getAudioDescriptions().size() > 0) {
aFilm.addAllUrls(aFilm.getAudioDescriptions());
}
}

private static Optional<URL> buildWebsiteUrl(
Expand Down

0 comments on commit 2d6eb39

Please sign in to comment.