Beispiel #1
0
 public async Task <bool> LoadInformation(ApiResult result)
 {
     using (var soundSource = await GetSoundSource())
     {
         return(LoadInformation(result, SoundSourceInfo.FromSoundSource(soundSource)));
     }
 }
Beispiel #2
0
 public bool LoadInformation(Entry ytResult, SoundSourceInfo soundSourceInfo)
 {
     Year     = (uint)DateTime.Parse(ytResult.published.Date).Year;
     Title    = ytResult.title.Name;
     Artist   = ytResult.author.First().name.Text;
     Uploader = ytResult.author.First().name.Text;
     kHz      = soundSourceInfo.kHz;
     SetDuration(soundSourceInfo.Duration);
     return(true);
 }
Beispiel #3
0
        public bool LoadInformation(ApiResult result, SoundSourceInfo soundSourceInfo)
        {
            if (!result.IsStreamable)
            {
                return(false);
            }
            Year = result.release_year != null
                ? uint.Parse(result.release_year.ToString())
                : (uint)DateTime.Parse(result.created_at).Year;

            Title      = result.title;
            ArtworkUrl = result.artwork_url != null?result.artwork_url.Replace("large.jpg", "{0}.jpg") : string.Empty;

            Artist       = result.user.username;
            Genres       = result.genre;
            SoundCloudID = result.id;
            Uploader     = result.user.username;
            Downloadable = result.downloadable;

            kHz = soundSourceInfo.kHz;
            SetDuration(soundSourceInfo.Duration);
            return(true);
        }