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}"); }
private void PrintTokenExpiration(TVDBInfo tvdbInfo) { DateTime expiration = tvdbInfo.GetExpiration(); string expireWord = "expires"; if (tvdbInfo.TokenIsExpired) { expireWord = "expired"; } MenuHelpers.WriteColorVT24Bit($"Token {expireWord} on ", "#dbbbf5"); MenuHelpers.WriteColorVT24Bit($"{expiration.ToString("MM/dd/yyyy hh:mm tt")}", "#ce5374"); Console.WriteLine(); }