jshackles / Enhanced_Steam

Enhances the Steam Experience
www.EnhancedSteam.com
GNU General Public License v3.0
1.32k stars 195 forks source link

Wishlist Price Calculation Bug #1574

Open samiscool51 opened 6 years ago

samiscool51 commented 6 years ago

hi the plugin is having problems calculating the wishlist price s this feature is something i use often to calculate how much my wishlist is going to cost me if i just bought all of the games at once (last time i calculated it, it was ~$3000 USD) i don't have much programming experience but it's seems that the method that is calculating the cost is unable to calculate the cost due to an integer overflow (i think) if you are using an integer i think using a string (is that what it is called?) could fix this issue and prevent it from happening in the future thanks for reading this bug report guys!

lingsamuel commented 5 years ago

My wishlist has almost 2200 items, and it always shows 0. One of my friends has 400 items, and it shows 0, too. Another friend of mine has 180 items on his wishlist, and every time refreshes the page, it shows a different result. Mostly it shows 15 ~ 20 items. I log the result and compare it with the whole list, I found that the ES price list only contains the first 15 ~ 20 items (exclude DLC). So I guess the reason for this bug is the calculator cannot handle the new Steam frontend, which loads data dynamically. It works well before the Steam frontend update. If add some filter and the result only contains a small number of items(such as 5), it will work correctly again.

lingsamuel commented 5 years ago

Hmm.. Seems that it's a expected behavior.

// Calculate total cost of all items on wishlist
function add_wishlist_total(showTotal) {
    if ($('.wishlist_row').length < 100 || showTotal) {
// ...remains code
        } else {
        $("#wishlist_ctn").after("<div class='es_show_wishlist_total btn_darkblue_white_innerfade'><span>" + localized_strings.show_wishlist_total + "<span></div>");
        $(document).on("click", ".es_show_wishlist_total", function(){
            $(this).remove();
            add_wishlist_total(true);
        });
    }

But I think this button doesn't exist in my page...

lingsamuel commented 5 years ago

Like what I said in the previous comment, the new Steam frontend behavior: load data dynamically: image It only contains part of my wishlist, and when I scroll the page, the nodes change accordingly.

And the reason for the bug which the extension only calculates first 15 ~ 20 items, that's because when the extension loaded, Steam only rendered the first 15 ~ 20 items, so the selector can only select them.

lingsamuel commented 5 years ago

An alternative wishlist calculator script: https://gist.github.com/lingsamuel/fbd7efd321750610c421e3d5b74a9bb3

VanityFox commented 4 years ago

So, Enhanced Steam is discontinued. There is now Augmented Steam. Perhaps your requested feature/bugfix is already implemented there! If not, you could move your issue there.