示例#1
0
        public override async Task <bool> AddToLibrary(OnlineSong song)
        {
            if (!RequiresAuthentication)
            {
                return(await MusicProvider.ProcessTracks(new List <FullTrackData> {
                    new FullTrackData(song.Name, song.TrackData.Artist, song.TrackData.AlbumArtist, song.TrackData.Album, song.TrackData.Genre)
                    {
                        AlbumArtwork = new List <AlbumArtwork> {
                            new AlbumArtwork {
                                Url = string.Format("http://img.youtube.com/vi/{0}/0.jpg", song.TrackData.Id)
                            }
                        },
                        MediaType = MediaType.Video,
                        ServiceId = Api.Identifier,
                        Id = song.TrackData.Id,
                        ServiceType = ServiceType.YouTube,
                        FileExtension = "mp3",
                        Disc = song.TrackData.Disc,
                        Track = song.TrackData.Track,
                        Year = song.TrackData.Year,
                    }
                }));
            }
            var notes = new Notes
            {
                Album       = song.TrackData.Album,
                AlbumArtist = song.TrackData.AlbumArtist,
                Artist      = song.TrackData.Artist,
                Disc        = song.TrackData.Disc,
                Title       = song.Name,
                Genre       = song.TrackData.Genre,
                Track       = song.TrackData.Track,
                Year        = song.TrackData.Year,
            };

            var plistId = await GetOrCreatePlaylistId();

            var playlist = new Playlist()
            {
                Id = plistId
            };

            return(await AddToPlaylist(song.TrackData, playlist, notes.ToJson()));
        }
示例#2
0
        public override async Task <bool> AddToLibrary(OnlineSong song)
        {
            var notes = new Notes
            {
                Album       = song.TrackData.Album,
                AlbumArtist = song.TrackData.AlbumArtist,
                Artist      = song.TrackData.Artist,
                Disc        = song.TrackData.Disc,
                Title       = song.Name,
                Genre       = song.TrackData.Genre,
                Track       = song.TrackData.Track,
                Year        = song.TrackData.Year,
            };

            var plistId = await GetOrCreatePlaylistId();

            var playlist = new Playlist()
            {
                Id = plistId
            };

            return(await AddToPlaylist(song.TrackData, playlist, notes.ToJson()));
        }
示例#3
0
 public override Task <bool> AddToLibrary(OnlineSong song)
 {
     return(SetRating(song.TrackData, 5));
 }
示例#4
0
        public async Task <bool> AddToLibrary(OnlineSong song)
        {
            var api = ApiManager.Shared.GetMusicProvider(song.TrackData.ServiceId);

            return(await api.AddToLibrary(song));
        }
示例#5
0
 public Task <bool> AddTemp(OnlineSong onlineSong)
 {
     return(MusicProvider.AddTemp(onlineSong));
 }
示例#6
0
 public override Task <bool> AddToLibrary(OnlineSong song)
 {
     throw new NotImplementedException();
 }