ma.addImageSize(image.width, image.height, baseUrl + "original" + image.file_path); ma.addImageSize(500, image.height * 500 / image.width, baseUrl + "w500" + image.file_path); ma.addImageSize(342, image.height * 342 / image.width, baseUrl + "w342" + image.file_path); ma.addImageSize(185, image.height * 185 / image.width, baseUrl + "w185" + image.file_path); ma.addImageSize(image.width, image.height, baseUrl + "original" + image.file_path); ma.addImageSize(1280, image.height * 1280 / image.width, baseUrl + "w1280" + image.file_path); ma.addImageSize(300, image.height * 300 / image.width, baseUrl + "w300" + image.file_path);
private List<MediaArtwork> prepareArtwork(List<Image> images, ImageType type) { List<MediaArtwork> artworks = new ArrayList<>(); for (Image image : ListUtils.nullSafe(images)) { MediaArtwork ma = new MediaArtwork(providerInfo.getId(), type.type); ma.setDefaultUrl(image.url); ma.setPreviewUrl(image.url.replace("/fanart/", "/preview/")); ma.setLanguage(image.lang); ma.setLikes(image.likes); ma.addImageSize(type.width, type.height, image.url); ma.setSizeOrder(type.sizeOrder); if ("all".equals(image.season)) { ma.setSeason(0); } else { try { ma.setSeason(Integer.valueOf(image.season)); } catch (Exception ignored) { } } artworks.add(ma); // fanart.tv only knows clearlogo; copy that for the logo type if (type.type == MediaArtworkType.CLEARLOGO) { artworks.add(new MediaArtwork(ma, MediaArtworkType.LOGO)); } } return artworks; }
int width = Integer.parseInt(matcher.group(1)); int height = Integer.parseInt(matcher.group(2)); ma.addImageSize(width, height, artworkUrl + image.fileName);