bool VideoMetadata::FillDataFromFilename(const VideoMetadataListManager &cache) { if (m_imp->getFilename().isEmpty()) return false; VideoMetadataListManager::VideoMetadataPtr mp = cache.byFilename(m_imp->getFilename()); if (mp) { *this = *mp; return true; } return false; }
DTC::VideoMetadataInfo* Video::GetVideoByFilename( const QString &Filename ) { VideoMetadataListManager::metadata_list videolist; VideoMetadataListManager::loadAllFromDatabase(videolist); VideoMetadataListManager *mlm = new VideoMetadataListManager(); mlm->setList(videolist); VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byFilename(Filename); if ( !metadata ) throw( QString( "No metadata found for selected filename!." )); DTC::VideoMetadataInfo *pVideoMetadataInfo = GetInfoFromMetadata(metadata); delete mlm; return pVideoMetadataInfo; }