Beispiel #1
0
        static async Task Extract(ExtractOptions o)
        {
            var progress = o.Verbose ? consoleProgress : null;

            if (!o.Commu &&
                !o.Parameter &&
                !o.Image &&
                !o.Lyrics &&
                !o.All)
            {
                Console.Error.WriteLine("No data specified to extract. Use --help for guidelines on usage.");
                return;
            }

            using ArcFile arcFile = new ArcFile(o.Input);
            if (o.Commu)
            {
                await arcFile.ExtractCommusToXlsx(o.Output, o.Overwrite, progress);
            }
            if (o.Parameter)
            {
                await arcFile.ExtractParameterToXlsx(o.Output, o.Overwrite, progress);
            }
            if (o.Image)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractAllImages(o.Output, progress);
            }
            if (o.Lyrics)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractLyrics(o.Output, o.Overwrite, progress);
            }
            if (o.All)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractAllAsync(o.Output, false, progress);
            }
        }
Beispiel #2
0
        public async Task ExtractLyrics()
        {
            try
            {
                ClearStatus();
                string dirName = _getFileName.SaveGetFileName("Select New Folder", ArcFile.RemoveArcExtension(ArcPath).Item1 + "_lyrics", "");
                if (dirName != null)
                {
                    await ArcFile.ExtractLyrics(dirName, true, ProgressReporter);

                    ReportMessage("Done.");
                }
            }
            catch (Exception ex)
            {
                ReportException(ex);
            }
        }
Beispiel #3
0
 public async Task ExtractLyricsTest(string arcName, string outDir)
 {
     using ArcFile arcFile = new ArcFile(arcName);
     await arcFile.ExtractLyrics(outDir, true);
 }