Commit 0a27ad4b authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

unittests: MediaLibraryTester: Add a helper to force last played date

parent ba8a318f
...@@ -206,6 +206,13 @@ bool MediaLibraryTester::setMediaInsertionDate( int64_t mediaId, time_t t ) ...@@ -206,6 +206,13 @@ bool MediaLibraryTester::setMediaInsertionDate( int64_t mediaId, time_t t )
return sqlite::Tools::executeUpdate( getConn(), req, t, mediaId ); return sqlite::Tools::executeUpdate( getConn(), req, t, mediaId );
} }
bool MediaLibraryTester::setMediaLastPlayedDate( int64_t mediaId, time_t lastPlayedDate )
{
std::string req = "UPDATE " + Media::Table::Name + " SET last_played_date = ? "
"WHERE id_media = ?";
return sqlite::Tools::executeUpdate( getConn(), req, lastPlayedDate, mediaId );
}
bool MediaLibraryTester::outdateAllExternalMedia() bool MediaLibraryTester::outdateAllExternalMedia()
{ {
std::string req = "UPDATE " + Media::Table::Name + " SET last_played_date = 1 " std::string req = "UPDATE " + Media::Table::Name + " SET last_played_date = 1 "
......
...@@ -75,6 +75,7 @@ public: ...@@ -75,6 +75,7 @@ public:
void deleteMedia( int64_t mediaId ); void deleteMedia( int64_t mediaId );
bool outdateAllDevices(); bool outdateAllDevices();
bool setMediaInsertionDate( int64_t mediaId, time_t t ); bool setMediaInsertionDate( int64_t mediaId, time_t t );
bool setMediaLastPlayedDate( int64_t mediaId, time_t lastPlayedDate );
bool outdateAllExternalMedia(); bool outdateAllExternalMedia();
bool setMediaType( int64_t mediaId, IMedia::Type type ); bool setMediaType( int64_t mediaId, IMedia::Type type );
uint32_t countNbThumbnails(); uint32_t countNbThumbnails();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment