Beispiel #1
0
        public static void Main(string[] args)
        {
            var commandParser = new FileReader();
            var input = commandParser.GetPreviousCommand();

            var moduleRunner = new ModuleRunner();
            moduleRunner.Execute(input);
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            var commandParser = new FileReader();
            var input         = commandParser.GetPreviousCommand();

            var moduleRunner = new ModuleRunner();

            moduleRunner.Execute(input);
        }
Beispiel #3
0
        public void Parse_RssDownloader_module()
        {
            var xdoc     = XDocument.Load("XmlSamples\\RssModule.xml");
            var xelement = xdoc.Root.Element("Module");

            var           moduleRunner = new ModuleRunner();
            RssDownloader module       = moduleRunner.ParseRssDownloader(xelement);

            Assert.AreEqual("RssDownloader01", module.Name);
            Assert.IsTrue(module.ContentMatcher.Match("dexter.mkv"));
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            var commandParser = new CommandParser();
            var command = commandParser.Parse();

            var moduleRunner = new ModuleRunner();
            moduleRunner.Execute(command);

            var commandRunner = new CommandRunner();
            commandRunner.Execute(command);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            string filename = null;

            Logging.Log.Info("##START##");
            try
            {
                if (args.Length > 0)
                {
                    if (!String.IsNullOrEmpty(args[0]))
                    {
                        filename = args[0];
                    }
                }

                var moduleRunner = new ModuleRunner();
                moduleRunner.RunModules();
                Logging.Log.Debug("Modules loaded");

                IMediaScanner scanner = new XmlMediaScanner();
                Logging.Log.Debug("Mediascanner loaded");

                if (!Directory.Exists(Config.StorageFolder))
                {
                    Directory.CreateDirectory(Config.StorageFolder);
                }

                if (!String.IsNullOrEmpty(filename))
                {
                    bool isValidFile = IsValidFile(filename);

                    if (!isValidFile)
                    {
                        throw new Exception(filename + " is not a valid file. Scan stopped.");
                    }

                    Logging.Log.InfoFormat("Scanning single file {0} ", filename);
                    scanner.Scan(filename);
                }
                else
                {
                    Logging.Log.Debug("Doing a complete scan");
                    scanner.Scan();
                }
            }
            catch (System.Exception ex)
            {
                Logging.Log.Info("Application stopped due to an unhandled error", ex);
            }

            Logging.Log.Info("##DONE##");
        }