mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
BUG-1862: Changed the Imgur API from v2 to v3
This commit is contained in:
parent
f77d35e104
commit
56339b629c
4 changed files with 62 additions and 86 deletions
|
@ -166,19 +166,12 @@ namespace GreenshotImgurPlugin
|
|||
}
|
||||
nodes = doc.GetElementsByTagName("datetime");
|
||||
if(nodes.Count > 0) {
|
||||
try
|
||||
// Version 3 has seconds since Epoch
|
||||
double secondsSince;
|
||||
if (double.TryParse(nodes.Item(0).InnerText, out secondsSince))
|
||||
{
|
||||
imgurInfo.Timestamp = DateTime.Parse(nodes.Item(0).InnerText);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Version 3 has seconds since Epoch
|
||||
double secondsSince;
|
||||
if (double.TryParse(nodes.Item(0).InnerText, out secondsSince))
|
||||
{
|
||||
var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
||||
imgurInfo.Timestamp = epoch.AddSeconds(secondsSince).DateTime;
|
||||
}
|
||||
var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
||||
imgurInfo.Timestamp = epoch.AddSeconds(secondsSince).DateTime;
|
||||
}
|
||||
}
|
||||
nodes = doc.GetElementsByTagName("original");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue