Esempio n. 1
0
        public async Task <Result> LoveSong()
        {
            var lastFMService = new LastFMService();

            var songInfo = await GetNowPlaying();

            if (songInfo.Loved)
            {
                return new Result()
                       {
                           Ok        = true,
                           ErrorCode = 0,
                           Message   = "You already liked this song"
                       }
            }
            ;

            var status = await lastFMService.LoveSong(songInfo.Artist, songInfo.Song);

            ThumbUp();

            return(new Result
            {
                Ok = true,
                ErrorCode = 0,
                Message = $"You liked {songInfo.Song} song. Status: {status}"
            });
        }
Esempio n. 2
0
        public async Task <Result> LoveSong()
        {
            ConnectIfNotConnected();

            using (var lastFMService = new LastFMService())
            {
                var mpdInfo = await GetNowPlaying(false);

                var mpdSong = GetCurrentSong();

                if (mpdInfo.Loved)
                {
                    return new Result()
                           {
                               Ok        = true,
                               ErrorCode = 0,
                               Message   = "You already liked this song"
                           }
                }
                ;

                var status = await lastFMService.LoveSong(mpdInfo.Artist, mpdInfo.Song);

                SaveToFavoritesPlaylist(mpdSong);

                return(new Result
                {
                    Ok = true,
                    ErrorCode = 0,
                    Message = $"You liked {mpdInfo.Song} song. Status: {status}"
                });
            }
        }