Package com.pugh.sockso.music

Examples of com.pugh.sockso.music.Artist


        final Properties p = new StringProperties();
        final Downloader d = new Downloader();
       
        d.setProperties( p );
       
        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = new Track.Builder()
                .artist( artist )
                .album( album )
                .genre( genre )
                .id(3)
                .name("track")
                .number(4)
                .path("")
                .dateAdded(new Date())
                .build();

        final String path = d.getTrackZipPath( track );
       
        assertTrue( path.contains(artist.getName()) );
        assertTrue( path.contains(album.getName()) );
        assertTrue( path.contains(track.getName()) );
        assertTrue( path.contains("04") ); // tens should be padded
       
    }
View Full Code Here


    private Track getTrack( final String artistName ) {
        return getTrack( artistName, "album", "year" );
    }
   
    private Track getTrack( final String artistName, final String albumName, final String albumYear ) {
        final Artist artist = new Artist.Builder()
                .id(1)
                .name(artistName)
                .build();
        final Album album = new Album.Builder()
                .artist(artist)
View Full Code Here

                               " order by ar.name asc ";
            st = db.prepare( sql );
            rs = st.executeQuery();

            while ( rs.next() ) {
                final Artist artist = new Artist.Builder()
                        .id(rs.getInt("id"))
                        .name(rs.getString("name"))
                        .build();
                final MusicTreeNode node = new MusicTreeNode( artist );
                node.add( new DefaultMutableTreeNode() );
View Full Code Here

        ResultSet rs = null;
        PreparedStatement st = null;

        try {

            final Artist artist = new Artist.Builder()
                    .id(item.getId())
                    .name(item.getName())
                    .build();
           
            final String sql = " select al.id, al.name, al.year " +
View Full Code Here

            else if ( type.equals(MusicItem.PLAYLIST) ) {
                Playlist playlist = (Playlist) item;
                sql = Playlist.getSelectTracksSql(playlist.getId(),"");
            }
            else if ( type.equals(MusicItem.ARTIST) ) {
                Artist artist = (Artist) item;
                sql = Track.getSelectFromSql() +
                        " where t.artist_id = '" + artist.getId() + "' ";
            }
            else if ( type.equals(MusicItem.ALBUM) ) {
                Album album = (Album) item;
                sql = Track.getSelectFromSql() +
                        " where t.album_id = '" + album.getId() + "' ";
View Full Code Here

     */
   
    @Override
    public void handleRequest() throws IOException, SQLException, BadRequestException {
       
        final Artist artist = Artist.find(
            getDatabase(),
            Integer.parseInt( getRequest().getUrlParam(2) )
        );
       
        if ( artist == null ) {
View Full Code Here

            st.setInt( 1, total );
            rs = st.executeQuery();

            final List<Album> recentAlbums = new ArrayList<Album>();
            while ( rs.next() ) {
                final Artist artist = new Artist.Builder()
                        .id(rs.getInt("artistId"))
                        .name(rs.getString("artistName"))
                        .build();
                recentAlbums.add( new Album.Builder()
                        .artist( artist )
View Full Code Here

    }

    public void testIssue109() throws Exception {
        TAlbums tpl = new TAlbums();
        List<Album> albums = new ArrayList<Album>();
        final Artist artist = new Artist.Builder().id(1).name("Artist\"").build();
        albums.add( new Album.Builder()
                .artist(artist)
                .id(2)
                .name("Album\"")
                .year("1980")
View Full Code Here

        final Latester b = new Latester();
        final List<Track> tracks = new ArrayList<Track>();
        final List<Artist> artists = new ArrayList<Artist>();
        final List<Album> albums = new ArrayList<Album>();

        final Artist artist = TestUtils.getArtist();
        final Album album = TestUtils.getAlbum(artist);
        final Genre genre = TestUtils.getGenre();
        final Track track = TestUtils.getTrack(artist, album, genre);

        tracks.add( track );
        artists.add( artist );
        albums.add( album );
       
        b.setResponse( res );
        b.showLatest( tracks, artists, albums );
       
        final String data = res.getOutput();

        assertTrue( data.contains(artist.getName()) );
        assertTrue( data.contains(track.getName()) );
       
    }
View Full Code Here

            st.setInt( 1, id );
            rs = st.executeQuery();
            if ( !rs.next() )
                throw new BadRequestException( "album not found", 404 );

            final Artist artist = new Artist.Builder()
                    .id(rs.getInt("artistId"))
                    .name(rs.getString("artistName"))
                    .build();

            return new Album.Builder()
View Full Code Here

TOP

Related Classes of com.pugh.sockso.music.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.