Package com.groovesquid.model

Examples of com.groovesquid.model.Album


        if(searchQuery.contains("http://grooveshark.com/")) {
            Pattern p = Pattern.compile(".*/\\s*(.*)");
            Matcher m = p.matcher(searchQuery);
            if(m.find()) {
                final String albumID = m.group(1);
                Album album = searchAlbumByID(albumID);
                if(album != null) {
                    albums.add(album);
                    return albums;
                }
            }
        }
       
        if(Utils.isNumeric(searchQuery)) {
            Album album = searchAlbumByID(searchQuery);
            if(album != null) {
                albums.add(album);
                return albums;
            }
        }
       
        HashMap<String, Object>[] result = gson.fromJson(Grooveshark.sendRequest("getResultsFromSearch", new HashMap<String, Object>(){{
            put("query", searchQuery);
            put("type", new String[] {"Albums"});
            put("guts", "0");
            put("ppOverride", "false");
        }}), SearchResponse.class).getResult().getResult().getAlbums();

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

        for (HashMap<String, Object> hm : result) {
            albums.add(new Album(
                hm.get("AlbumID"),
                hm.get("Name"),
                hm.get("ArtistID"),
                hm.get("ArtistName")
            ));
View Full Code Here


        if(result.isEmpty() || result.get("AlbumID").toString().startsWith("0")) {
            return null;
        }

        Album album = new Album(
            result.get("AlbumID"),
            result.get("Name"),
            result.get("ArtistID"),
            result.get("ArtistName")
        );
View Full Code Here

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

    public Object getValueAt(int row, int col) {
        Album album = albums.get(row);

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

                SongSearchTableModel songSearchTableModel = (SongSearchTableModel) searchTable.getModel();
                Song song = songSearchTableModel.getSongs().get(selectedRow);
                downloadTableModel.addRow(0, Services.getDownloadService().download(song, getDownloadListener(downloadTableModel)));
            } else if (searchTable.getModel() instanceof AlbumSearchTableModel) {
                AlbumSearchTableModel albumSearchTableModel = (AlbumSearchTableModel) searchTable.getModel();
                final Album album = albumSearchTableModel.getAlbums().get(selectedRow);
                SwingWorker<List<Song>, Void> worker = new SwingWorker<List<Song>, Void>(){

                    @Override
                    protected List<Song> doInBackground() {
                        return Services.getSearchService().searchSongsByAlbum(album);
View Full Code Here

TOP

Related Classes of com.groovesquid.model.Album

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.