Beispiel #1
0
        private SongInfo GetLyricsAndSongInfoByVK(File audioFile, string fileName)
        {
            var authorize = new VkAuthorization();
            var api = authorize.Authorize();
            var songLyricsAndInfoGetter = new SongLyricsAndInfoGetter(api);
            var titleEncoded = audioFile.Tag.Title.ToUtf8();
            var artistEncoded = audioFile.Tag.Artists.ConvertStringArrayToString().ToUtf8();

            if (string.IsNullOrEmpty(titleEncoded) == false)
            {
                var info = songLyricsAndInfoGetter.GetSongInfo(artistEncoded + " " + titleEncoded);
                if (info != null)
                {
                    return info;
                }

            }

            if (string.IsNullOrEmpty(fileName) == false)
            {
                var info = songLyricsAndInfoGetter.GetSongInfo(fileName);

                if (info != null)
                {
                    return info;
                }
            }

            return null;
        }
 public VkAudioService(string login, string password)
 {
     var vkAuthorization = new VkAuthorization(login, password);
     _vkApi = vkAuthorization.Authorize();
 }
Beispiel #3
0
 public UserSongsGet(string login, string password)
 {
     var vkAuthorization = new VkAuthorization(login, password);
     _vkApi = vkAuthorization.Authorize();
 }
 public VkAudioService()
 {
     var vkAuthorization = new VkAuthorization();
     _vkApi = vkAuthorization.Authorize();
 }