Пример #1
0
 private void SetNewTokenAndSaveToFile(string newToken)
 {
     _tvdbInfo.Token = newToken;
     _tvdbInfo.TokenRetrievedDate = DateTime.Now;
     _tvdbInfo.SaveToFile(_tvdbInfoFilePath);
     Log.Information($"New token expires on {_tvdbInfo.GetExpiration().ToString("MM/dd/yyyy hh:mm tt")}");
     Log.Information($"Saved authentication info to {_tvdbInfoFilePath}");
 }
Пример #2
0
        static void ReadTVDBInfo()
        {
            string   filePath = GetTVDBInfoFilePath();
            TVDBInfo tvdbInfo = TVDBInfo.ReadFromFile(filePath);

            tvdbInfo.TokenRetrievedDate = DateTime.Now.AddDays(-1);
            Console.WriteLine($"apiKey from TVDBInfo: {tvdbInfo.ApiKey}. DateTime: {tvdbInfo.TokenRetrievedDate}");
            tvdbInfo.SaveToFile(filePath);
        }
Пример #3
0
 static void SetNewTokenAndSaveToFile(ref TVDBInfo tvdbInfo, string token, string filePath)
 {
     tvdbInfo.Token = token;
     tvdbInfo.TokenRetrievedDate = DateTime.Now;
     tvdbInfo.SaveToFile(filePath);
 }