1
0
Fork 0
mirror of synced 2024-09-29 08:51:43 +13:00

ImageUrlModel: Add more types for lookup.

The issue happened with Farming Simulator 22 freebie, because it doesn't
least a tall image. This should be checked again in the future.
This commit is contained in:
loathingKernel 2024-05-28 22:54:40 +03:00
parent 9419ff402b
commit 4587c73671
2 changed files with 5 additions and 3 deletions

View file

@ -45,8 +45,8 @@ class ImageUrlModel:
@dataclass
class KeyImagesModel:
key_images: Optional[List[ImageUrlModel]] = None
tall_types = ("DieselStoreFrontTall", "OfferImageTall", "Thumbnail", "ProductLogo", "DieselGameBoxLogo")
wide_types = ("DieselStoreFrontWide", "OfferImageWide", "VaultClosed", "ProductLogo")
tall_types = ("DieselGameBoxTall", "DieselStoreFrontTall", "OfferImageTall", "DieselGameBoxLogo", "Thumbnail", "ProductLogo")
wide_types = ("DieselGameBoxwide", "DieselStoreFrontWide", "OfferImageWide", "DieselGameBox", "VaultClosed", "ProductLogo")
def __getitem__(self, item):
return self.key_images[item]

View file

@ -176,7 +176,9 @@ class StoreDetailsWidget(QWidget, SideTabContents):
key_images = self.catalog_offer.keyImages
img_url = key_images.for_dimensions(self.image.size().width(), self.image.size().height())
self.image.fetchPixmap(img_url.url)
# FIXME: check why there was no tall image
if img_url:
self.image.fetchPixmap(img_url.url)
# self.image_stack.setCurrentIndex(0)
about = product_data.about