public AnalysisCache Analyse(MusicFolder folder)
        {
            var result = new AnalysisCache();
            
            foreach (var file in folder.Files)
            {
                result.Files.Add(new DataFile{FullPath = file.Path});
            }

            folder.Analysis = result;
            return result;
        }
        public void ProcessFolder(MusicFolder folder)
        {
            if (folder.Analysis != null) return;

            if(!_analyser.IsValid(folder)) _processor.Process(folder);

            if (!_analyser.IsValid(folder))
                BadFolders.Add(folder); // TODO: probably change these tests
            else
                GoodFolders.Add(folder);

            folder.Analysis = new AnalysisCache();
        }
        public AnalysisCache Analyse(MusicFolder folder)
        {
            var result = new AnalysisCache();

            foreach (var file in folder.Files)
            {
                result.Files.Add(new DataFile {
                    FullPath = file.Path
                });
            }

            folder.Analysis = result;
            return(result);
        }
        public bool IsValid(MusicFolder folder)
        {
            if (!folder.Files.Any())
            {
                return(false);
            }

            if (folder.Files.Any(IsArtistMissing))
            {
                return(false);
            }

            if (folder.Files.Any(IsAlbumMissing))
            {
                return(false);
            }

            if (folder.Files.Any(IsTrackNumberMissing))
            {
                return(false);
            }

            if (folder.Files.Any(IsTrackNameMissing))
            {
                return(false);
            }

            if (folder.Files.Any(IsTrackNumberInvalid))
            {
                return(false);
            }

            if (IsTrackNumberSequenceIncomplete(folder))
            {
                return(false);
            }

            if (folder.Files.Any(x => x.ArtistName != folder.Files[0].ArtistName))
            {
                return(false);
            }

            if (folder.Files.Any(x => x.AlbumTitle != folder.Files[0].AlbumTitle))
            {
                return(false);
            }

            return(true);
        }
        public bool IsValid(MusicFolder folder)
        {
            if (!folder.Files.Any()) return false;

            if (folder.Files.Any(IsArtistMissing)) return false;

            if (folder.Files.Any(IsAlbumMissing)) return false;

            if (folder.Files.Any(IsTrackNumberMissing)) return false;

            if (folder.Files.Any(IsTrackNameMissing)) return false;

            if (folder.Files.Any(IsTrackNumberInvalid)) return false;

            if (IsTrackNumberSequenceIncomplete(folder)) return false;

            if (folder.Files.Any(x => x.ArtistName != folder.Files[0].ArtistName)) return false;

            if (folder.Files.Any(x => x.AlbumTitle != folder.Files[0].AlbumTitle)) return false;

            return true;
        }
Ejemplo n.º 6
0
        public void ProcessFolder(MusicFolder folder)
        {
            if (folder.Analysis != null)
            {
                return;
            }

            if (!_analyser.IsValid(folder))
            {
                _processor.Process(folder);
            }

            if (!_analyser.IsValid(folder))
            {
                BadFolders.Add(folder); // TODO: probably change these tests
            }
            else
            {
                GoodFolders.Add(folder);
            }

            folder.Analysis = new AnalysisCache();
        }
 public void Process(MusicFolder folder)
 {
     // TODO: ?
 }
 public void Process(MusicFolder folder)
 {
     // TODO: ?
 }