Timezone fixes to EPG and Scheduled
This commit is contained in:
CompoUK
2015-04-06 09:35:21 +01:00
parent 03cef75e32
commit 8992b42333
+11 -16
View File
@@ -668,19 +668,16 @@ namespace MediaBrowser.Plugins.VuPlus
recordingInfo.CommunityRating = 0; recordingInfo.CommunityRating = 0;
Double sdated = Convert.ToDouble(e2time); long sdated = Int64.Parse(e2time);
DateTime sdate = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime(); //Set default date 1/1/1970 DateTime sdate = ApiHelper.DateTimeFromUnixTimestampSeconds(sdated);
sdate = sdate.AddSeconds(sdated); //add seconds
recordingInfo.StartDate = sdate.ToUniversalTime(); recordingInfo.StartDate = sdate.ToUniversalTime();
//length in format mm:ss //length in format mm:ss
string[] words = e2length.Split(':'); string[] words = e2length.Split(':');
Double mins = Convert.ToDouble(words[0]); long mins = Int64.Parse(words[0]);
Double seconds = Convert.ToDouble(words[1]); long seconds = Int64.Parse(words[1]);
long edated = Int64.Parse(e2time) + (mins * 60) + (seconds);
Double edated = Convert.ToDouble(e2time) + (mins * 60) + (seconds); DateTime edate = ApiHelper.DateTimeFromUnixTimestampSeconds(edated);
DateTime edate = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime(); //Set default date 1/1/1970
edate = edate.AddSeconds(edated); //add seconds
recordingInfo.EndDate = edate.ToUniversalTime(); recordingInfo.EndDate = edate.ToUniversalTime();
//recordingInfo.EpisodeTitle = e2title; //recordingInfo.EpisodeTitle = e2title;
@@ -1365,7 +1362,7 @@ namespace MediaBrowser.Plugins.VuPlus
XmlNodeList e2event = xml.GetElementsByTagName("e2event"); XmlNodeList e2event = xml.GetElementsByTagName("e2event");
foreach (XmlNode xmlNode in e2event) foreach (XmlNode xmlNode in e2event)
{ {
var programInfo = new ProgramInfo(); var programInfo = new ProgramInfo();
var e2eventid = "?"; var e2eventid = "?";
@@ -1418,9 +1415,8 @@ namespace MediaBrowser.Plugins.VuPlus
} }
} }
Double sdated = Convert.ToDouble(e2eventstart); long sdated = Int64.Parse(e2eventstart);
DateTime sdate = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime(); //Set default date 1/1/1970 DateTime sdate = ApiHelper.DateTimeFromUnixTimestampSeconds(sdated);
sdate = sdate.AddSeconds(sdated); //add seconds
// Check whether the current element is within the time range passed // Check whether the current element is within the time range passed
if (sdate > endDateUtc) if (sdate > endDateUtc)
@@ -1462,9 +1458,8 @@ namespace MediaBrowser.Plugins.VuPlus
programInfo.Overview = e2eventdescriptionextended; programInfo.Overview = e2eventdescriptionextended;
Double edated = Convert.ToDouble(e2eventstart) + Convert.ToDouble(e2eventduration); long edated = Int64.Parse(e2eventstart) + Int64.Parse(e2eventduration);
DateTime edate = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToUniversalTime(); //Set default date 1/1/1970 DateTime edate = ApiHelper.DateTimeFromUnixTimestampSeconds(edated);
edate = edate.AddSeconds(edated); //add seconds
programInfo.StartDate = sdate.ToUniversalTime(); programInfo.StartDate = sdate.ToUniversalTime();
programInfo.EndDate = edate.ToUniversalTime(); programInfo.EndDate = edate.ToUniversalTime();