void AbstractResource::fetchScreenshots() { QList<QUrl> thumbs, screens; QUrl thumbnail = thumbnailUrl(); if(!thumbnail.isEmpty()) { thumbs << thumbnail; screens << screenshotUrl(); } emit screenshotsFetched(thumbs, screens); }
void YTLocalVideoData::thumbnailDownloadFinished(QByteArray data) { Q_ASSERT(!_thumbnailPath.isEmpty()); QFile thumbFile(_thumbnailPath); // TODO: Handle open and write failures thumbFile.open(QIODevice::WriteOnly); thumbFile.write(data); thumbFile.close(); emit thumbnailUrlChanged(thumbnailUrl()); qDebug() << "Finished downloading thumbnail for video:" << _videoId; }