Examples of CoverImpl


Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

            for (int i = 0; i < images.length(); i++) {
                JSONObject image = images.getJSONObject(i);
                if (image.has("type")) {
                    String type = image.getString("type");
                    if ("primary".equalsIgnoreCase(type)) {
                        CoverImpl cover = new CoverImpl();
                        cover.setThumbUri(image.getString("uri150"));
                        cover.setImageUri(image.getString("uri"));
                        covers.add(cover);
                        break;
                    }
                }
            }
View Full Code Here

Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

        String responseStatus = json.getString("responseStatus");
        if("200".equals(responseStatus)) {
            JSONArray results = json.getJSONObject("responseData").getJSONArray("results");
            for (int i = 0; i < results.length(); i++) {
                JSONObject result = results.getJSONObject(i);
                CoverImpl cover = new CoverImpl();
                cover.setThumbUri(result.getString("tbUrl"));
                cover.setImageUri(result.getString("url"));
                covers.add(cover);
            }
        } else {
            throw new IOException("Reponse status: " + responseStatus);
        }
View Full Code Here

Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

    }

    private void showExistingCover(File coverFile) {
        ImageIcon cover = loadCover(coverFile);
        if (cover != null) {
            CoverImpl c = new CoverImpl();
            CoverWrapper wrap = new CoverWrapper(c, null);
            wrap.setImage(cover);
            showCover(wrap);
            titledBorder.setTitle(I18N.translate("current_cover"));
        }
View Full Code Here

Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

        if (json.has("thumbnail_url")) {
            String thumbUri = json.getString("thumbnail_url");
            String previewUri = thumbUri.replaceAll("/cover/", "/85/");
            String imageUri = thumbUri.replaceAll("/cover/", "/300/");

            CoverImpl cover = new CoverImpl();
            cover.setThumbUri(previewUri);
            cover.setImageUri(imageUri);
            covers.add(cover);
        }
        return covers;
    }
View Full Code Here

Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

        checkStatus(doc);

        NodeList imgs = doc.getElementsByTagName("image");
        List<Cover> result = new ArrayList<Cover>(imgs.getLength());
        if(imgs.getLength() > 0) {
            CoverImpl cover = new CoverImpl();

            // select the img
            String imgUri;
            if( (imgUri = getImage(imgs, "extralarge")) != null) {
                cover.setImageUri(imgUri);
            } else if( (imgUri = getImage(imgs, "large")) != null) {
                cover.setImageUri(imgUri);
            } else if( (imgUri = getImage(imgs, "medium")) != null) {
                cover.setImageUri(imgUri);
            }

            // select the thumb
            if( (imgUri = getImage(imgs, "medium")) != null) {
                cover.setThumbUri(imgUri);
            } else if( (imgUri = getImage(imgs, "large")) != null) {
                cover.setThumbUri(imgUri);
            } else if( (imgUri = getImage(imgs, "extralarge")) != null) {
                cover.setThumbUri(imgUri);
            }

            result.add(cover);
        }
        return result;
View Full Code Here

Examples of net.sf.jmp3renamer.plugins.CoverGrabber.CoverImpl

        JSONObject json = new JSONObject(response);
        if ("ok".equalsIgnoreCase(json.getString("status"))) {
            JSONObject result = json.getJSONObject("result");
            JSONObject album = result.getJSONObject(rdioAlbum.getId());

            CoverImpl cover = new CoverImpl();
            cover.setThumbUri(album.getString("icon"));
            cover.setImageUri(album.getString("icon400"));
            covers.add(cover);
        }

        return covers;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.