bool VideoMetadata::fillDataFromID(const VideoMetadataListManager &cache) { if (m_imp->getID() == 0) return false; VideoMetadataListManager::VideoMetadataPtr mp = cache.byID(m_imp->getID()); if (mp.get()) { *this = *mp; return true; } return false; }
bool Video::RemoveVideoFromDB( int Id ) { bool bResult = false; VideoMetadataListManager::metadata_list videolist; VideoMetadataListManager::loadAllFromDatabase(videolist); VideoMetadataListManager *mlm = new VideoMetadataListManager(); mlm->setList(videolist); VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(Id); if (metadata) bResult = metadata->DeleteFromDatabase(); delete mlm; return bResult; }
DTC::VideoMetadataInfo* Video::GetVideoById( int Id ) { VideoMetadataListManager::metadata_list videolist; VideoMetadataListManager::loadAllFromDatabase(videolist); VideoMetadataListManager *mlm = new VideoMetadataListManager(); mlm->setList(videolist); VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(Id); if ( !metadata ) throw( QString( "No metadata found for selected ID!." )); DTC::VideoMetadataInfo *pVideoMetadataInfo = GetInfoFromMetadata(metadata); delete mlm; return pVideoMetadataInfo; }