Exemple #1
0
        //public static void addMetaData()  // Add the movie to the database?
        //{
        //    bool confirmed = false;
        //    while (!confirmed)
        //    {
        //        Console.WriteLine("\n  Add Movie metadata to MovieTable? Y or N ");
        //        string YorN = Console.ReadKey().Key.ToString().ToUpper();
        //        while (YorN != "Y") { CycleThuFolders(MovieDirPath());}
        //        Console.Write("\n\n  Hit any key for Main Menu"); Console.ReadKey();
        //        Program.AppMainMenu();
        //    }
        //}

        // One by one, use folder names to derive movie name then prompt user if correct movie
        public static object CycleThuFolders(string movieDir)
        {
            List <string> folderNames = GetFolders.GetFolderNames(movieDir);

            //cycle through folderNames by hitting API then checking of good reponse
            foreach (string name in folderNames)
            {
                string newname = name;
                Console.WriteLine("\n  Looking up movie: {0}", name);
                ResponseStrings OMDBResponse = OMDBWebRequest.GetOMDBWebRequest(name);
                while (OMDBResponse.Response == "False")
                {
                    //OMDBResponse.newname = name;
                    OMDBResponse = EditTitleLoop.TitleNotFound(name);
                }
                ;

                string          mTitle        = OMDBResponse.Title;
                string          mYear         = OMDBResponse.Year;
                string          mActors       = OMDBResponse.Actors;
                ResponseStrings OMDBResponse2 = EditTitleLoop.CorrectMovie(mTitle, mYear, mActors, name, OMDBResponse);
                AddMovie2Database(OMDBResponse2, movieDir);
            }
            return(null);
        }
        //if user needs to correct the movie title
        public static ResponseStrings EditTitle()
        {
            Console.WriteLine("\n  Please enter the correct movie title:  ");
            Console.WriteLine();
            string          name         = Console.ReadLine();
            ResponseStrings OMDBResponse = OMDBWebRequest.GetOMDBWebRequest(name);
            string          mTitle       = OMDBResponse.Title;
            string          mYear        = OMDBResponse.Year;
            string          mActors      = OMDBResponse.Actors;

            CorrectMovie(mTitle, mYear, mActors, name, OMDBResponse);
            Console.WriteLine(OMDBResponse.Title, "EditTitleMethod");

            return(OMDBResponse);
        }