HearthSim / Hearthstone-Deck-Tracker

A deck tracker and deck manager for Hearthstone on Windows
https://hsreplay.net/downloads/
4.61k stars 1.11k forks source link

Database - Buddies cards not updated #4558

Closed WittR closed 3 days ago

WittR commented 1 week ago

Expected Behavior

Get the updated cards of the buddies in the Database

Actual Behavior

New buddies and reworked buddies are not updated in the Database (for example Yogg Saron' buddy (TB_BaconShop_HERO_35_Buddy) : Former version : https://hearthstone.fandom.com/wiki/Battlegrounds/Acolyte_of_Yogg-Saron Updated version : https://hearthstone.wiki.gg/wiki/Battlegrounds/Acolyte_of_Yogg-Saron

Thanks a lot !

Steps to reproduce behavior

No response

Log/Screenshots

No response

beheh commented 1 week ago

Hey there! Can you clarify where they're not updated? Is this about card images or HearthstoneJSON or something? To my knowledge they wouldn't be shown anywhere in HDT.

WittR commented 1 week ago

Thanks for answering!

These cards (images) are actually not used by HDT, but I use them in a plugin (displaying buddies during streams). I thought all the cards in the HDT Database API would have been updated eventually. Do you think this database can be updated, or will it remain an unused legacy?

Thanks for your time.

beheh commented 4 days ago

I'm still a little confused. The image is updated in HearthstoneJSON (https://art.hearthstonejson.com/v1/bgs/latest/enUS/256x/TB_BaconShop_HERO_35_Buddy.png) and the card should be up-to-date in HearthDB as well. Can you show an example of the code where you're retrieving something about this Buddy and are seeing outdated data?

WittR commented 4 days ago

Hello! Thanks again for taking the time to help with my issue.

Here's the code I'm using: CardImage.SetCardIdFromCard(Database.GetCardFromId("TB_BaconShop_HERO_35_Buddy"));

I'm new to HDT plugins, so I appreciate your patience !

beheh commented 4 days ago

Are your cards showing mana crystals in the top left corner by any chance? In that case you might be accessing the normal renders (https://art.hearthstonejson.com/v1/render/latest/enUS/256x/TB_BaconShop_HERO_35_Buddy.png) instead of the Battlegrounds render (https://art.hearthstonejson.com/v1/bgs/latest/enUS/256x/TB_BaconShop_HERO_35_Buddy.png). We no longer update the mana crystal versions, to sped up our rendering pipeline after a new patch and because they're not used anywhere.

From your code it seems you're probably using the CardImage class, which downloads the image via the cardImageDownloader. That class loads the Battlegrounds version if you set BaconCard to true on the card.

Try updating your code like this:

var card = Database.GetCardFromId("TB_BaconShop_HERO_35_Buddy");
card.BaconCard = true;
CardImage.SetCardIdFromCard(card);
WittR commented 3 days ago

Thank you very much, it works !