Ejemplo n.º 1
0
        internal async Task <Core.Models.Artist> GetArtistInfoAsync(string artist)
        {
            if (!Settings.Current.DataPlayEnabled)
            {
                return(new Core.Models.Artist()
                {
                    AvatarUri = null,
                    Description = "Disabled fetching according to setting",
                    Name = artist
                });
            }
            var querys = new ValueSet()
            {
                new KeyValuePair <string, object>("action", "artist"),
                new KeyValuePair <string, object>("artist", artist),
                new KeyValuePair <string, object>("q", "online_meta"),
            };
            var result = await OnlineMetaExtension.ExecuteAsync(querys);

            if (result is Core.Models.Artist s)
            {
                return(s);
            }
            return(null);
        }
Ejemplo n.º 2
0
        internal async Task <Core.Models.Artist> GetArtistInfoAsync(string artist)
        {
            if (!Settings.Current.DataPlayEnabled && Microsoft.Toolkit.Uwp.Connectivity.NetworkHelper.Instance.ConnectionInformation.IsInternetOnMeteredConnection)
            {
                return(new Core.Models.Artist()
                {
                    AvatarUri = null,
                    Description = "Disabled fetching according to setting",
                    Name = artist
                });
            }
            var querys = new ValueSet()
            {
                new KeyValuePair <string, object>("action", "artist"),
                new KeyValuePair <string, object>("artist", artist),
                new KeyValuePair <string, object>("q", "online_meta"),
            };
            var result = await OnlineMetaExtension.ExecuteAsync(querys);

            if (result is Core.Models.Artist s)
            {
                return(s);
            }
            return(null);
        }
Ejemplo n.º 3
0
        internal async Task <AlbumInfo> GetAlbumInfoAsync(string album, string artist)
        {
            if (!Settings.Current.DataPlayEnabled)
            {
                return(new AlbumInfo()
                {
                    AltArtwork = null,
                    Description = "Disabled fetching according to setting",
                    Artist = artist,
                    Name = album
                });
            }
            var querys = new ValueSet()
            {
                new KeyValuePair <string, object>("album", album),
                new KeyValuePair <string, object>("artist", artist),
                new KeyValuePair <string, object>("action", "album"),
                new KeyValuePair <string, object>("q", "online_meta"),
            };
            var result = await OnlineMetaExtension.ExecuteAsync(querys);

            if (result is AlbumInfo s)
            {
                return(s);
            }
            return(null);
        }
Ejemplo n.º 4
0
        internal async Task <Core.Models.Artist> GetArtistInfoAsync(string artist)
        {
            var querys = new ValueSet()
            {
                new KeyValuePair <string, object>("action", "artist"),
                new KeyValuePair <string, object>("artist", artist),
                new KeyValuePair <string, object>("q", "online_meta"),
            };
            var result = await OnlineMetaExtension.ExecuteAsync(querys);

            if (result is Core.Models.Artist s)
            {
                return(s);
            }
            return(null);
        }
Ejemplo n.º 5
0
        internal async Task <AlbumInfo> GetAlbumInfoAsync(string album, string artist)
        {
            var querys = new ValueSet()
            {
                new KeyValuePair <string, object>("album", album),
                new KeyValuePair <string, object>("artist", artist),
                new KeyValuePair <string, object>("action", "album"),
                new KeyValuePair <string, object>("q", "online_meta"),
            };
            var result = await OnlineMetaExtension.ExecuteAsync(querys);

            if (result is AlbumInfo s)
            {
                return(s);
            }
            return(null);
        }