Example #1
0
        private void TagAndRenameVideos_Load(object sender, EventArgs e)
        {
            InitRootTree();
            InitObjectListViewFilesAndTags();
            NavigateTree();

            VideoInformation.ThetvDB = new TheTVDB_API_v2.TheTVDB();

            Task <bool> t;

            if (Configuration.TheTVDBApiKey != null && Configuration.TheTVDBApiKey.Trim().Length > 0)
            {
                t = VideoInformation.ThetvDB.AuthenticateAsync(Configuration.TheTVDBApiKey);
            }
            else
            {
                FrmSettings settings = new FrmSettings();
                settings.SelectTheTVDBApiKey();
                settings.ShowDialog();
                t = VideoInformation.ThetvDB.AuthenticateAsync(Configuration.TheTVDBApiKey);
                //t = VideoInformation.ThetvDB.AuthenticateAsync(apiKey);
            }

            t.GetAwaiter().OnCompleted(() => {
                if (!t.Result)
                {
                    //t = tvDB.AuthenticateAsync(apiKey);
                    MessageBox.Show("Failed to Authenticate to the TV DB!\nPlease check your API Key settings.");
                }
            });
        }
Example #2
0
        private void btnSettings_Click(object sender, EventArgs e)
        {
            FrmSettings settings = new FrmSettings();

            settings.SelectTheTVDBApiKey();
            settings.ShowDialog();

            Task <bool> t;

            t = VideoInformation.ThetvDB.AuthenticateAsync(Configuration.TheTVDBApiKey);

            t.GetAwaiter().OnCompleted(() =>
            {
                if (!t.Result)
                {
                    //t = tvDB.AuthenticateAsync(apiKey);
                    MessageBox.Show("Failed to Authenticate to the TV DB!\nPlease check your API Key settings.");
                }
            });
        }