コード例 #1
0
        public void CreateArtworkFile(string path, IMedia media)
        {
            var image     = ImageCache.Instance.GetImage(media);
            var imageName = image?.FileType.AppendExtension($"{PathHelpers.CreateDefaultFileName(media)} (Cover)");

            var fileName = Path.Combine(path, imageName);

            AthameWriter.Write(fileName, image);
        }
コード例 #2
0
 public void CreatePlaylistFile(string path, IMedia media, IEnumerable <TrackFile> trackFiles, PlaylistFileType type)
 {
     try
     {
         var playlistFile = PlaylistFile
                            .Create(type)
                            .BuildContent(trackFiles);
         var fileName = Path.Combine(path, PathHelpers.CreateDefaultFileName(media));
         AthameWriter.Write(fileName, playlistFile);
     }
     catch (Exception ex)
     {
         Log.Warning(ex, "Exception occurred when writing playlist file");
     }
 }
コード例 #3
0
 public void CreateMediaInfo(string path, ITrackCollection media)
 {
     try
     {
         var info = MediaInfo
                    .Create(media.MediaType)
                    .BuildContent(media);
         var fileName = Path.Combine(path, info.Name);
         AthameWriter.Write(fileName, info);
     }
     catch (Exception ex)
     {
         Log.Warning(ex, "Exception occurred when writing mediainfo file.");
     }
 }