Example #1
0
        public FileDifferences[] GetDifferences()
        {
            var list = new List<FileDifferences>();
            foreach (var mp3 in _files)
            {
                var mp3Data = mp3.GetId3Data();

                var extracter = new DataExtracter(_mask);
                var tags = extracter.GetTags();
                var prefixes = extracter.FindAllPrefixes(tags);
                var diffs = new FileDifferences(mp3);
                var data = extracter.GetFullDataFromString(prefixes, Path.GetFileNameWithoutExtension(mp3.FilePath), tags);

                var differenceItems = data.Where(item => mp3Data[item.Key] != item.Value).ToArray();

                if (!differenceItems.Any()) continue;

                foreach (var item in differenceItems)
                {
                    diffs.Add(item.Key, new Diff { FileNameValue = item.Value, TagValue = mp3Data[item.Key] });
                }

                list.Add(diffs);
            }

            return list.ToArray();
        }
Example #2
0
        public Mp3TagChanger(IMp3File mp3File, string mask, ISaver backuper)
        {
            Mp3 = mp3File;

            Backuper = backuper;
            _mask = mask;

            Mp3RealName = Path.GetFileNameWithoutExtension(mp3File.FilePath);
            _dataExtracter = new DataExtracter(_mask);
        }
Example #3
0
        public Mp3FileNameChanger(IMp3File file, string mask, ISaver saver, bool fastChanges = false)
        {
            _mp3File = file;
            Id3Data = new Dictionary<TagType, string>();

            _dataExtracter = new DataExtracter(mask);

            _fastChanges = fastChanges;

            _saver = saver;
            _mask = mask;
        }