Example #1
0
        private List<Playlist> GenPlaylist()
        {
            List<Playlist> playlist = new List<Playlist>();
            int st = -PlaylistUploadMax;

            for(int i = 0; i < PlaylistUploadMax - recent.Count; i++)
            {
                Playlist song = new Playlist();
                song.AlbumName = "";
                song.ArtistName = "";
                song.songid = "";
                song.SongName = "";
                song.State = st++;
                playlist.Add(song);
            }
            if (recent.Count > 0)
            {
                playlist.AddRange(getfromQueryList(recent, ref st, PlaylistUploadMax));
            }
            playlist.Add(setPlaylistData(currentSong, st++));
            if (upcoming.Count > 0)
            {
                playlist.AddRange(getfromQueryList(upcoming, ref st, PlaylistUploadMax));
            }

            return playlist;
        }
Example #2
0
 private Playlist setPlaylistData(QueriedSong song, int state)
 {
     Playlist p = new Playlist();
     p.AlbumName = song.Album;
     p.ArtistName = song.Artist;
     p.songid = song.SongId;
     p.SongName = song.SongName;
     p.State = state;
     return p;
 }