Ejemplo n.º 1
0
        private static string LookupSeriesFolder(string seriesName)
        {
            List <string> targetFolders = ListParser.GetSection(SHOW_NAMES, _configs);
            string        compactName   = StringUtility.StripNonAlphaNumerics(seriesName).ToLower();
            string        foundName     = ListParser.Get(compactName, targetFolders);

            return(foundName);
        }
Ejemplo n.º 2
0
        public static void Process(string[] args)
        {
            try
            {
                List <string> targetFolders = ListParser.GetSection(TV_FOLDERS, _configs);

                Console.WriteLine(args.Count() + " arguments");
                if (args.Count() > 0)
                {
                    args = StripExtraQuotes(args);

                    foreach (string item in args)
                    {
                        Console.WriteLine(item);
                    }
                }

                if (!IsArgFound(args, "skip"))
                {
                    if (IsArgFound(args, "re-copy"))
                    {
                        CopyAllFilesInADirectory("N:\\Torrents\\complete", targetFolders);
                    }

                    bool?isSingleFile = IsSingleFile(args);

                    if (isSingleFile.HasValue)
                    {
                        if (isSingleFile.Value)
                        {
                            string   filename = string.Format("{0}\\{1}", args[0], args[1]);
                            FileInfo file     = new FileInfo(filename);

                            ProcessAFile(file, targetFolders);
                        }
                        else
                        {
                            CopyAllFilesInADirectory(args[0], targetFolders);
                        }
                    }

                    if (IsArgFound(args, "pause"))
                    {
                        Pause();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.StackTrace);
                Pause();
            }
        }