using System.IO; using JD.Asset.Types.Map; using JDSongConverter.Tasks; using TeaBox.Macros; namespace JDSongConverter.Converters { public class Jd2016Updater : Converter { private readonly CopyDirectoryTask _copyDirectoryTask = new CopyDirectoryTask(); private readonly MovePreviewAndVolumeToTrkTask _moveToTrkTask = new MovePreviewAndVolumeToTrkTask(); private readonly CreateOnlineCoverTask _createOnlineTask = new CreateOnlineCoverTask(); private readonly DeleteSongGamemodeTask _deleteSongGamemodeTask = new DeleteSongGamemodeTask(); private readonly CleanUpTrkErrorTask _cleanUpTrkErrorTask = new CleanUpTrkErrorTask(); public Jd2016Updater() { Tasks.Add(_copyDirectoryTask); Tasks.Add(_moveToTrkTask); Tasks.Add(_createOnlineTask); Tasks.Add(_deleteSongGamemodeTask); Tasks.Add(_cleanUpTrkErrorTask); } public override void Process(JDSong song, string outputDir, string mapPathRelative, IExecutionContext executionContext) { _copyDirectoryTask.Enabled = !File.Exists(Map.FromPath(outputDir).SongDescPath); _copyDirectoryTask.Init(song.RootPath, outputDir); base.Process(song, outputDir, mapPathRelative, executionContext); } } }