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

Fix download card image repeatedly when file exists #4239

Closed chucklu closed 3 years ago

chucklu commented 3 years ago

https://github.com/HearthSim/Hearthstone-Deck-Tracker/blob/f7b70235276a3bec055795e06801242ece1d7b9b/Hearthstone%20Deck%20Tracker/Utility/Assets/AssetDownloader.cs#L230

public bool HasAsset(T obj)
        {
            if(obj == null)
                return false;
            var filename = _getFilename(obj);
            return _succesfullyDownloadedImages.Contains(filename);
        }

The filename you get from var filename = _getFilename(obj); contains file extension, why you get files without extension. It make the HDT always download the image file again and again.

chucklu commented 3 years ago

@azeier @riQQ @jleclanche Any feedback?

azeier commented 3 years ago

Thanks for the PR! I think this was a leftover from late changes made to the AssetDownloader.

@Jonysegal can you take a quick look at this and merge it?

chucklu commented 3 years ago

@Jonysegal Any update?

chucklu commented 3 years ago

@azeier @Jonysegal Any update?