Package com.groovesquid.model

Examples of com.groovesquid.model.Playlist


        if(searchQuery.contains("http://grooveshark.com/")) {
            Pattern p = Pattern.compile(".*/\\s*(.*)");
            Matcher m = p.matcher(searchQuery);
            if(m.find()) {
                final String playlistID = m.group(1);
                Playlist playlist = searchPlaylistByID(playlistID);
                if(playlist != null) {
                    playlists.add(playlist);
                    return playlists;
                }
            }
        }
       
        if(Utils.isNumeric(searchQuery)) {
            Playlist playlist = searchPlaylistByID(searchQuery);
            if(playlist != null) {
                playlists.add(playlist);
                return playlists;
            }
        }

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

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

        for (HashMap<String, Object> hm : result) {
            playlists.add(new Playlist(
                hm.get("PlaylistID"),
                hm.get("Name"),
                hm.get("FName"),
                hm.get("NumSongs")
            ));
View Full Code Here


        if(result.isEmpty() || result.get("PlaylistID").toString().startsWith("0")) {
            return null;
        }
        System.out.println("+++ " + result.get("PlaylistID"));
        Playlist playlist = new Playlist(
            playlistID,
            result.get("Name"),
            result.get("FName"),
            result.get("NumSongs") != null ? result.get("NumSongs") : result.get("SongCount") != null ? result.get("SongCount") : "0"
        );
View Full Code Here

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

    public Object getValueAt(int row, int col) {
        Playlist playlist = playlists.get(row);

        switch (col) {
            case 0: return playlist.getName();
            case 1: return playlist.getAuthor();
            case 2: return playlist.getNumSongs();
        }
        return null;
    }
View Full Code Here

                };
                worker.execute();

            } else if (searchTable.getModel() instanceof PlaylistSearchTableModel) {
                PlaylistSearchTableModel playlistSearchTableModel = (PlaylistSearchTableModel) searchTable.getModel();
                final Playlist playlist = playlistSearchTableModel.getPlaylists().get(selectedRow);
                SwingWorker<List<Song>, Void> worker = new SwingWorker<List<Song>, Void>(){

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

TOP

Related Classes of com.groovesquid.model.Playlist

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.