MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / fetchCaptures

Method fetchCaptures

MediaLibrary/animeworker.cpp:802–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800}
801
802int AnimeWorker::fetchCaptures(const QString &animeName, QList<AnimeImage> &captureList, int offset, int limit)
803{
804 ThreadTask task(GlobalObjects::workThread);
805 return task.Run([&](){
806 QSqlQuery query(DBManager::instance()->getDB(DBManager::Bangumi));
807 query.prepare("select Type, TimeId,Info,Thumb from image where Anime=? and (Type=? or Type=?) order by TimeId desc limit ? offset ?");
808 query.bindValue(0,animeName);
809 query.bindValue(1,AnimeImage::CAPTURE);
810 query.bindValue(2,AnimeImage::SNIPPET);
811 query.bindValue(3,limit);
812 query.bindValue(4,offset);
813 query.exec();
814 int typeNo=query.record().indexOf("Type"),
815 timeIdNo=query.record().indexOf("TimeId"),
816 infoNo=query.record().indexOf("Info"),
817 thumbNo=query.record().indexOf("Thumb");
818 int count=0;
819 while (query.next())
820 {
821 AnimeImage img;
822 img.type = AnimeImage::ImageType(query.value(typeNo).toInt());
823 img.timeId = query.value(timeIdNo).toLongLong();
824 img.info = query.value(infoNo).toString();
825 img.setRoundedThumb(QImage::fromData(query.value(thumbNo).toByteArray()));
826 captureList.append(img);
827 ++count;
828 }
829 return count;
830 }).toInt();
831}
832
833void AnimeWorker::loadAnimeInfoTag(AnimeInfoTag &animeInfoTags)
834{

Callers 1

fetchMoreMethod · 0.80

Calls 8

ImageTypeEnum · 0.85
getDBMethod · 0.80
valueMethod · 0.80
setRoundedThumbMethod · 0.80
toByteArrayMethod · 0.80
RunMethod · 0.45
toStringMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected