Пример #1
0
 /// <summary>
 /// Convertit l'entrée de playlist minifiée en réelle entrée de playlist
 /// </summary>
 /// <param name="youtube_client"></param>
 /// <param name="soundcloud_client"></param>
 /// <returns></returns>
 public PlayListEntry expand(Youtube.Youtube youtube_client, SoundCloud.SoundCloud soundcloud_client)
 {
     PlayListEntry p = null;
     if (this.url.StartsWith("https://www.youtube.com") || this.url.StartsWith("https://m.youtube.com"))
         p = new PlayListEntry(youtube_client.resolveTrack(this.url), this.user, false);
     else if (this.url.StartsWith("https://soundcloud.com/") || this.url.StartsWith("https://m.soundcloud.com/"))
         p = new PlayListEntry(soundcloud_client.resolveTrack(this.url), this.user, false);
     return p;
 }
Пример #2
0
 /// <summary>
 /// Transforme les messages présents dans la boite mail en entrées de playlist pour la lecture
 /// </summary>
 /// <param name="youtube_client">Instance du client youtube permettant d'interragir avec le service de vidéo en ligne</param>
 /// <param name="soundcloud_client">Instance du client soundcloud permettant d'interragir avec le service de son en ligne</param>
 /// <returns></returns>
 public List<Music.PlayListEntry> getPlaylistEntriesFromMail(Youtube.Youtube youtube_client, SoundCloud.SoundCloud soundcloud_client)
 {
     List<Music.PlayListEntry> res = new List<Music.PlayListEntry>();
     List<Gmail> msg = this.getMessages();
     foreach (Gmail g in msg)
     {
         Music.ITrack track = null;
         if (Youtube.Youtube.isCompatible(g.content))
             track = youtube_client.resolveTrack(g.content);
         else if (SoundCloud.SoundCloud.isCompatible(g.content))
             track = soundcloud_client.resolveTrack(g.content);
         if (track != null)
         {
             res.Add(new Music.PlayListEntry(track, g.user, false));
         }
     }
     return res;
 }