Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
daniel-kristjansson committed Jul 6, 2012
1 parent 3756e32 commit 103d8a1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
9 changes: 5 additions & 4 deletions mythtv/libs/libmythtv/HLS/httplivestream.cpp
Expand Up @@ -29,6 +29,7 @@
#include <QUrl>

#include "mythcorecontext.h"
#include "mythdate.h"
#include "mythdirs.h"
#include "mythtimer.h"
#include "mthreadpool.h"
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/recordingrule.cpp
Expand Up @@ -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();
}

Expand Down
7 changes: 5 additions & 2 deletions mythtv/programs/mythbackend/services/channel.cpp
Expand Up @@ -38,6 +38,7 @@
#include "sourceutil.h"
#include "cardutil.h"
#include "datadirect.h"
#include "mythdate.h"

#include "serviceUtil.h"

Expand Down Expand Up @@ -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() );
}
}
Expand Down Expand Up @@ -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() );
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/services/myth.cpp
Expand Up @@ -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() );
Expand Down
10 changes: 6 additions & 4 deletions mythtv/programs/mythbackend/upnpcdstv.cpp
Expand Up @@ -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();
Expand All @@ -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();

// ----------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythbackend/upnpcdsvideo.cpp
Expand Up @@ -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();

// ----------------------------------------------------------------------
Expand Down

0 comments on commit 103d8a1

Please sign in to comment.