Esempio n. 1
0
 public static async Task AddTags(IStorageFile resultFile, Song downloadSong)
 {
     using (var tagTemp = TagLib.File.Create(resultFile.AsAbstraction()))
     {
         tagTemp.Tag.Title            = downloadSong.Title;
         tagTemp.Tag.Album            = downloadSong.Album;
         tagTemp.Tag.AlbumArtists     = downloadSong.AlbumArtists;
         tagTemp.Tag.AlbumArtistsSort = downloadSong.AlbumArtistsSort;
         tagTemp.Tag.AlbumSort        = downloadSong.AlbumSort;
         tagTemp.Tag.TitleSort        = downloadSong.TitleSort;
         tagTemp.Tag.Track            = downloadSong.Track;
         tagTemp.Tag.TrackCount       = downloadSong.TrackCount;
         tagTemp.Tag.Disc             = downloadSong.Disc;
         tagTemp.Tag.Composers        = downloadSong.Composers;
         tagTemp.Tag.ComposersSort    = downloadSong.ComposersSort;
         tagTemp.Tag.Conductor        = downloadSong.Conductor;
         tagTemp.Tag.DiscCount        = downloadSong.DiscCount;
         tagTemp.Tag.Copyright        = downloadSong.Copyright;
         tagTemp.Tag.PerformersSort   = downloadSong.Genres;
         tagTemp.Tag.Lyrics           = downloadSong.Lyrics;
         tagTemp.Tag.Performers       = downloadSong.Performers;
         tagTemp.Tag.PerformersSort   = downloadSong.PerformersSort;
         tagTemp.Tag.Year             = downloadSong.Year;
         if (downloadSong.PicturePath != null)
         {
             if (tagTemp.Tag.Pictures != null && tagTemp.Tag.Pictures.Length > 0)
             {
             }
             else
             {
                 using (var referen = await(RandomAccessStreamReference.CreateFromUri(new Uri(downloadSong.PicturePath))).OpenReadAsync())
                 {
                     var p = new List <Picture>
                     {
                         new Picture(ByteVector.FromStream(referen.AsStream()))
                     };
                     tagTemp.Tag.Pictures = p.ToArray();
                 }
             }
         }
         tagTemp.Save();
     }
 }