Package com.groovesquid.model

Examples of com.groovesquid.model.Artist


        if(searchQuery.contains("http://grooveshark.com/")) {
            Pattern p = Pattern.compile(".*/\\s*(.*)");
            Matcher m = p.matcher(searchQuery);
            if(m.find()) {
                final String artistID = m.group(1);
                Artist artist = searchArtistByID(artistID);
                if(artist != null) {
                    artists.add(artist);
                    return artists;
                }
            }
        }
       
        if(Utils.isNumeric(searchQuery)) {
            Artist artist = searchArtistByID(searchQuery);
            if(artist != null) {
                artists.add(artist);
                return artists;
            }
        }

        HashMap<String, Object>[] result = gson.fromJson(Grooveshark.sendRequest("getResultsFromSearch", new HashMap<String, Object>(){{
            put("query", searchQuery);
            put("type", new String[] {"Artists"});
            put("guts", "0");
            put("ppOverride", "false");
        }}), SearchResponse.class).getResult().getResult().getArtists();

        if(result.length < 1) {
            JOptionPane.showMessageDialog(Main.getGui(), "No search results for \"" + searchQuery + "\".");
        }

        for (HashMap<String, Object> hm : result) {
            artists.add(new Artist(
                hm.get("ArtistID"),
                hm.get("Name")
            ));
        }
       
View Full Code Here


        if(result.isEmpty() || result.get("ArtistID").toString().startsWith("0")) {
            return null;
        }
        System.out.println("+++ " + result.get("ArtistID"));
        Artist artist = new Artist(
            artistID,
            result.get("Name")
        );

        return artist;
View Full Code Here

    public String getColumnName(int col) {
        return columnNames[col];
    }

    public Object getValueAt(int row, int col) {
        Artist artist = artists.get(row);

        switch (col) {
            case 0: return artist.getName();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.groovesquid.model.Artist

Copyright © 2018 www.massapicom. 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.