Esempio n. 1
0
        private Album CreateAlbum(GoogleMusicApi.Structure.Album album, List <GoogleMusicApi.Structure.Track> tracks)
        {
            var a = CreateAlbum(album);

            a.Tracks = new List <Track>(from t in tracks select CreateTrack(t));
            return(a);
        }
Esempio n. 2
0
 private Artist CreateArtist(GoogleMusicApi.Structure.Album album)
 {
     return(new Artist
     {
         Id = album.ArtistId[0],
         Name = album.AlbumArtist
     });
 }
Esempio n. 3
0
 public static Artist GetAthameArtist(this GoogleMusicApi.Structure.Album googlePlayAlbum)
 {
     return(new Artist
     {
         Id = googlePlayAlbum.ArtistId[0],
         Name = googlePlayAlbum.AlbumArtist
     });
 }
Esempio n. 4
0
        private Album CreateAlbum(GoogleMusicApi.Structure.Album gpmAlbum)
        {
            var a = new Album
            {
                Artist   = CreateArtist(gpmAlbum),
                CoverUri = new Uri(gpmAlbum.AlbumArtRef),
                Title    = gpmAlbum.Name,
                Tracks   = new List <Track>()
            };

            if (gpmAlbum.Tracks != null)
            {
                foreach (var track in gpmAlbum.Tracks)
                {
                    var cmTrack = CreateTrack(track);
                    cmTrack.Album = a;
                    ((List <Track>)a.Tracks).Add(cmTrack);
                }
            }
            return(a);
        }
Esempio n. 5
0
        public static Album ToAthameAlbum(this GoogleMusicApi.Structure.Album googlePlayAlbum)
        {
            var a = new Album
            {
                Artist       = googlePlayAlbum.GetAthameArtist(),
                CoverPicture = new GooglePlayPicture(googlePlayAlbum.AlbumArtRef),
                Title        = googlePlayAlbum.Name,
                Tracks       = new List <Track>(),
                Id           = googlePlayAlbum.AlbumId,
                Year         = googlePlayAlbum.Year
            };

            if (googlePlayAlbum.Tracks != null)
            {
                foreach (var track in googlePlayAlbum.Tracks)
                {
                    var athameTrack = track.ToAthameTrack();
                    athameTrack.Album = a;
                    a.Tracks.Add(athameTrack);
                }
            }
            return(a);
        }