Пример #1
0
        private static void LaunchSynchMode(string path, string pattern)
        {
            var folderProcessor = new FolderProcessor();
            folderProcessor.PrepareSynch(path, pattern);

            Console.WriteLine(Messeges.FilesToRename);
            foreach (var renameAction in folderProcessor.LateFileHandler.ToRename)
            {
                Console.WriteLine("\t\"{0}\" to \t\"{1}\"", renameAction.FilePath, renameAction.NewName);
            }

            Console.WriteLine(Messeges.FilesToTag);
            foreach (var retagAction in folderProcessor.LateFileHandler.ToRetag)
            {
                Console.WriteLine("\t{0} new tags:", retagAction.FilePath);
                foreach (var tag in retagAction.NewTags)
                {
                    Console.WriteLine("{0}: \"{1}\"", Frame.GetString(tag.Key), tag.Value);
                }
            }

            Console.WriteLine("OK? y/n");
            if (Console.ReadLine() == "y")
                folderProcessor.CompleteSych(new int[0]);
        }
Пример #2
0
 private static void LaunchDiffMode(string path, string pattern)
 {
     var folderProcessor = new FolderProcessor();
     var differences = folderProcessor.GetDifferences(path, pattern);
     foreach (var difference in differences)
     {
         if (difference.Value.Count != 0)
         {
             Console.WriteLine("{0} differences:", difference.Key);
             foreach (var value in difference.Value)
             {
                 Console.WriteLine("\t{0} in file: \"{1}\", in name: \"{2}\"", Frame.GetString(value.Key), value.Value.FileValue, value.Value.PathValue);
             }
         }
     }
 }
Пример #3
0
        public void NoDiffTests()
        {
            var fileSystem = new FileSystemBuilder().
                File(new FileBuilder().
                    FilePath("artist - song").
                    Tag(FrameType.Artist, "artist").
                    Tag(FrameType.Title, "song").
                    Build()).
                File(new FileBuilder().
                    FilePath("art - so").
                    Tag(FrameType.Artist, "art").
                    Tag(FrameType.Title, "so").
                    Build()).
                Build();
            var folderProcessor = new FolderProcessor(fileSystem,fileSystem);

            var differences = folderProcessor.GetDifferences("", "<ar> - <ti>");

            Assert.AreEqual(0,differences.Count);
        }