1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-25 12:23:36 +01:00

if we are created remotely, use their creation date

This commit is contained in:
Leo Franchi 2011-04-15 19:12:40 -04:00
parent dca94f864d
commit ab72ee2302

View File

@ -88,8 +88,16 @@ DatabaseCommand_CreatePlaylist::createPlaylist( DatabaseImpl* lib, bool dynamic)
Q_ASSERT( !( m_playlist.isNull() && m_v.isNull() ) );
Q_ASSERT( !source().isNull() );
uint now = QDateTime::currentDateTime().toTime_t();
m_playlist->setCreatedOn( now );
uint now = 0;
if( m_playlist.isNull() )
{
now = m_v.toMap()[ "createdon" ].toUInt();
}
else
{
now = QDateTime::currentDateTime().toTime_t();
m_playlist->setCreatedOn( now );
}
TomahawkSqlQuery cre = lib->newquery();
cre.prepare( "INSERT INTO playlist( guid, source, shared, title, info, creator, lastmodified, dynplaylist, createdOn) "