예제 #1
0
        public void Process(object obj)
        {
            try
            {
                NumProcessed++;

                LoggerWriter.WriteDelimiter(Tokens.Info);
                LoggerWriter.WriteLine(Tokens.Info, "Analysing directory: \"" + (obj as DirectoryInfo).FullName + "\"");

                DateTime startTime = DateTime.Now;

                ProcessDirectory(obj as DirectoryInfo);

                LoggerWriter.WriteStep(Tokens.Info, "Time required", (DateTime.Now - startTime).ToString());
            }
            catch (Exception e)
            {
                LoggerWriter.WriteLine(Tokens.Exception, e);
            }
        }
예제 #2
0
        public override void Process(object obj)
        {
            try
            {
                NumProcessed++;

                LoggerWriter.WriteDelimiter(Tokens.Info);
                LoggerWriter.WriteLine(Tokens.Info, "Analysing directory: \"" + (obj as DirectoryInfo).FullName + "\"");

                DateTime startTime = DateTime.Now;

                AlbumExplorer.AlbumResult result = Explorer.ExploreDirectory(obj as DirectoryInfo);

                if (result.Album.Result != AlbumExplorer.ParseResult.NoMp3s)
                {
                    if (result.Album.Result == AlbumExplorer.ParseResult.Fine)
                    {
                        LoggerWriter.WriteStep(Tokens.Info, "Status", "Required information found."
                                               + " Artist: \"" + result.Album.Words[FrameMeaning.Artist] + "\""
                                               + " Album: \"" + result.Album.Words[FrameMeaning.Album] + "\"");
                        WebQuery(obj as DirectoryInfo, result.Album);
                    }
                    else if (result.Album.Result != AlbumExplorer.ParseResult.Fine)
                    {
                        LoggerWriter.WriteStep(Tokens.Info, "Status",
                                               "MP3 files missing minimum information required for query (artist+album)!");
                    }
                }

                LoggerWriter.WriteStep(Tokens.Info, "Time required", (DateTime.Now - startTime).ToString());
            }
            catch (Exception e)
            {
                LoggerWriter.WriteLine(Tokens.Exception, e);
            }
        }