Permalink
Browse files

Fixes #10877. Add MythDate::as_utc() wrapper where necessary.

There were a few datetime's from the database that didn't get wrapped in the UTC
conversion. Some because they were added after the initial conversion, but a couple
were just missed.
  • Loading branch information...
1 parent 3756e32 commit 103d8a1f8ccfdf5a4c377465b08df56431fa27d8 @daniel-kristjansson daniel-kristjansson committed Jul 6, 2012
@@ -29,6 +29,7 @@
#include <QUrl>
#include "mythcorecontext.h"
+#include "mythdate.h"
#include "mythdirs.h"
#include "mythtimer.h"
#include "mthreadpool.h"
@@ -101,8 +102,8 @@ HTTPLiveStream::HTTPLiveStream(QString srcFile, uint16_t width, uint16_t height,
m_bitrate(bitrate),
m_audioBitrate(abitrate), m_audioOnlyBitrate(aobitrate),
m_sampleRate(srate),
- m_created(QDateTime::currentDateTime()),
- m_lastModified(QDateTime::currentDateTime()),
+ m_created(MythDate::current()),
+ m_lastModified(MythDate::current()),
m_percentComplete(0),
m_status(kHLSStatusUndefined)
{
@@ -671,8 +672,8 @@ bool HTTPLiveStream::LoadFromDB(void)
m_curSegment = query.value(7).toUInt();
m_segmentCount = query.value(8).toUInt();
m_percentComplete = query.value(9).toUInt();
- m_created = query.value(10).toDateTime();
- m_lastModified = query.value(11).toDateTime();
+ m_created = MythDate::as_utc(query.value(10).toDateTime());
+ m_lastModified = MythDate::as_utc(query.value(11).toDateTime());
m_relativeURL = query.value(12).toString();
m_fullURL = query.value(13).toString();
m_status = (HTTPLiveStreamStatus)(query.value(14).toInt());
@@ -180,9 +180,9 @@ bool RecordingRule::Load(bool asTemplate)
// and influence watch list weighting
if (!asTemplate)
{
- m_nextRecording = query.value(43).toDateTime();
- m_lastRecorded = query.value(44).toDateTime();
- m_lastDeleted = query.value(45).toDateTime();
+ m_nextRecording = MythDate::as_utc(query.value(43).toDateTime());
+ m_lastRecorded = MythDate::as_utc(query.value(44).toDateTime());
+ m_lastDeleted = MythDate::as_utc(query.value(45).toDateTime());
m_averageDelay = query.value(46).toInt();
}
@@ -38,6 +38,7 @@
#include "sourceutil.h"
#include "cardutil.h"
#include "datadirect.h"
+#include "mythdate.h"
#include "serviceUtil.h"
@@ -562,7 +563,8 @@ DTC::VideoMultiplexList* Channel::GetVideoMultiplexList( int nSourceID,
pVideoMultiplex->setRollOff( query.value(19).toString() );
pVideoMultiplex->setSIStandard( query.value(20).toString() );
pVideoMultiplex->setServiceVersion( query.value(21).toInt() );
- pVideoMultiplex->setUpdateTimeStamp( query.value(22).toDateTime() );
+ pVideoMultiplex->setUpdateTimeStamp(
+ MythDate::as_utc(query.value(22).toDateTime()));
pVideoMultiplex->setDefaultAuthority( query.value(23).toString() );
}
}
@@ -642,7 +644,8 @@ DTC::VideoMultiplex* Channel::GetVideoMultiplex( int nMplexID )
pVideoMultiplex->setRollOff( query.value(18).toString() );
pVideoMultiplex->setSIStandard( query.value(19).toString() );
pVideoMultiplex->setServiceVersion( query.value(20).toInt() );
- pVideoMultiplex->setUpdateTimeStamp( query.value(21).toDateTime() );
+ pVideoMultiplex->setUpdateTimeStamp(
+ MythDate::as_utc(query.value(21).toDateTime()));
pVideoMultiplex->setDefaultAuthority( query.value(22).toString() );
}
@@ -496,7 +496,7 @@ DTC::LogMessageList *Myth::GetLogs( const QString &HostName,
pLogMessage->setFilename( query.value(5).toString() );
pLogMessage->setLine( query.value(6).toInt() );
pLogMessage->setFunction( query.value(7).toString() );
- pLogMessage->setTime( query.value(8).toDateTime() );
+ pLogMessage->setTime(MythDate::as_utc(query.value(8).toDateTime()));
pLogMessage->setLevel( logLevelGetName(
(LogLevel_t)query.value(9).toInt()) );
pLogMessage->setMessage( query.value(10).toString() );
@@ -285,8 +285,8 @@ void UPnpCDSTv::AddItem( const UPnpCDSRequest *pRequest,
MSqlQuery &query )
{
int nChanid = query.value( 0).toInt();
- QDateTime dtStartTime = query.value( 1).toDateTime();
- QDateTime dtEndTime = query.value( 2).toDateTime();
+ QDateTime dtStartTime = MythDate::as_utc(query.value(1).toDateTime());
+ QDateTime dtEndTime = MythDate::as_utc(query.value(2).toDateTime());
QString sTitle = query.value( 3).toString();
QString sSubtitle = query.value( 4).toString();
QString sDescription = query.value( 5).toString();
@@ -296,8 +296,10 @@ void UPnpCDSTv::AddItem( const UPnpCDSRequest *pRequest,
uint64_t nFileSize = query.value( 9).toULongLong();
QString sBaseName = query.value(10).toString();
- QDateTime dtProgStart = query.value(11).toDateTime();
- QDateTime dtProgEnd = query.value(12).toDateTime();
+ QDateTime dtProgStart =
+ MythDate::as_utc(query.value(11).toDateTime());
+ QDateTime dtProgEnd =
+ MythDate::as_utc(query.value(12).toDateTime());
QString sStorageGrp = query.value(13).toString();
// ----------------------------------------------------------------------
@@ -252,7 +252,8 @@ void UPnpCDSVideo::AddItem( const UPnpCDSRequest *pRequest,
// int nSeason = query.value(10).toInt();
// int nEpisode = query.value(11).toInt();
QString sCoverArt = query.value(12).toString();
- QDateTime dtInsertDate = query.value(13).toDateTime();
+ QDateTime dtInsertDate =
+ MythDate::as_utc(query.value(13).toDateTime());
QString sHostName = query.value(14).toString();
// ----------------------------------------------------------------------

0 comments on commit 103d8a1

Please sign in to comment.