Commit f6ac7bea authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Don't generate a thumbnail if the media already has one

Including if the previous generation failed. Assume that without an
explicit change, such as an update, a subsequent thumbnail request will
also fail
parent ee01a0d7
......@@ -500,6 +500,8 @@ class IMediaLibrary
* this media, to be run asynchronously.
* Upon completion (successful or not) IMediaLibraryCb::onMediaThumbnailReady
* will be called.
* In case a thumbnail was already generated for the media, false will be returned.
* If so, no callback will be invoked
*/
virtual bool requestThumbnail( MediaPtr media ) = 0;
......
......@@ -1500,6 +1500,8 @@ bool MediaLibrary::requestThumbnail( MediaPtr media )
{
if ( m_thumbnailer == nullptr )
return false;
if ( media->isThumbnailGenerated() == true )
return false;
m_thumbnailer->requestThumbnail( media );
return true;
}
......
Markdown is supported
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