コード例 #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
ファイル: Program.cs プロジェクト: ptgullas/EpisodeRenamer
        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
ファイル: Program.cs プロジェクト: ptgullas/EpisodeRenamer
 static void SetNewTokenAndSaveToFile(ref TVDBInfo tvdbInfo, string token, string filePath)
 {
     tvdbInfo.Token = token;
     tvdbInfo.TokenRetrievedDate = DateTime.Now;
     tvdbInfo.SaveToFile(filePath);
 }