Small cosmetic code change for the scraper.

This commit is contained in:
Leon Styhre 2021-05-30 12:28:17 +02:00
parent 8b91905e9e
commit 9a8fd5c487
4 changed files with 11 additions and 10 deletions

View file

@ -235,12 +235,13 @@ void GuiScraperSearch::resizeMetadata()
it->first->setFont(fontLbl);
it->first->setSize(0, 0);
if (it->first->getSize().x() > maxLblWidth)
maxLblWidth = it->first->getSize().x() + (16 * Renderer::getScreenWidthModifier());
maxLblWidth = it->first->getSize().x() +
(16.0f * Renderer::getScreenWidthModifier());
}
for (unsigned int i = 0; i < mMD_Pairs.size(); i++)
mMD_Grid->setRowHeightPerc(i * 2, (fontLbl->getLetterHeight() +
(2 * Renderer::getScreenHeightModifier())) / mMD_Grid->getSize().y());
(2.0f * Renderer::getScreenHeightModifier())) / mMD_Grid->getSize().y());
// Update component fonts.
mMD_ReleaseDate->setFont(fontComp);
@ -283,7 +284,7 @@ void GuiScraperSearch::updateViewStyle()
mGrid.setEntry(mDescContainer, Vector2i(3, 0), false, false, Vector2i(1, 3),
GridFlags::BORDER_TOP | GridFlags::BORDER_BOTTOM);
// Make description text wrap at edge of container.
mResultDesc->setSize(mDescContainer->getSize().x(), 0);
mResultDesc->setSize(mDescContainer->getSize().x(), 0.0f);
}
else {
// Fake row where name would be.
@ -624,7 +625,7 @@ void GuiScraperSearch::update(int deltaTime)
for (auto it = results_media.cbegin(); it != results_media.cend(); it++) {
for (unsigned int i = 0; i < results_scrape.size(); i++) {
if (results_scrape[i].gameID == it->gameID) {
results_scrape[i].box3dUrl = it->box3dUrl;
results_scrape[i].box3DUrl = it->box3DUrl;
results_scrape[i].coverUrl = it->coverUrl;
results_scrape[i].marqueeUrl = it->marqueeUrl;
results_scrape[i].screenshotUrl = it->screenshotUrl;

View file

@ -182,9 +182,9 @@ MDResolveHandle::MDResolveHandle(const ScraperSearchResult& result,
mResult.savedNewMedia = false;
if (Settings::getInstance()->getBool("Scrape3DBoxes") && result.box3dUrl != "") {
mediaFileInfo.fileURL = result.box3dUrl;
mediaFileInfo.fileFormat = result.box3dFormat;
if (Settings::getInstance()->getBool("Scrape3DBoxes") && result.box3DUrl != "") {
mediaFileInfo.fileURL = result.box3DUrl;
mediaFileInfo.fileFormat = result.box3DFormat;
mediaFileInfo.subDirectory = "3dboxes";
mediaFileInfo.existingMediaFile = search.game->get3DBoxPath();
mediaFileInfo.resizeFile = true;

View file

@ -56,14 +56,14 @@ struct ScraperSearchResult {
std::string thumbnailImageData; // Thumbnail cache, this will contain the entire image.
std::string thumbnailImageUrl;
std::string box3dUrl;
std::string box3DUrl;
std::string coverUrl;
std::string marqueeUrl;
std::string screenshotUrl;
std::string videoUrl;
// Needed to pre-set the image type.
std::string box3dFormat;
std::string box3DFormat;
std::string coverFormat;
std::string marqueeFormat;
std::string screenshotFormat;

View file

@ -422,7 +422,7 @@ void ScreenScraperRequest::processGame(const pugi::xml_document& xmldoc,
if (media_list) {
// 3D box
processMedia(result, media_list, ssConfig.media_3dbox,
result.box3dUrl, result.box3dFormat, region);
result.box3DUrl, result.box3DFormat, region);
// Cover
processMedia(result, media_list, ssConfig.media_cover,
result.coverUrl, result.coverFormat, region);