HearthStats / hearthstats

Details Hearthstone match statistics and tracking.
hearthstats.net
Other
88 stars 44 forks source link

No duplicate matches #519

Closed Dbz closed 8 years ago

Dbz commented 8 years ago

I noticed that my HS Tracker would create many duplicate matches, and I would have to manually delete them. This will stop the creation of duplicate matches.

I COULD NOT GET HEARHTSTATS TO BUILD ON MY SYSTEM. Therefore, I was not actually able to test this, nor run the tests. I realize this is a big inconvenience for someone else to test, but I would greatly appreciate it. If this does not work, please tell me and I will update the code.

This pull request contains four things:

1) An == method for matches 2) A no_duplicate_matches validation for matches 3) A spec for the validation 4) Enforcing single/double quote styleguide rules as requested on the readme to gemfile, match.rb, and match_spec.rb

trigun0x2 commented 8 years ago

For some reason I did not get a notification for this PR! Reviewing!

Dbz commented 8 years ago

@trigun0x2 , thank you for reviewing my pull request. I appreciate it! I was only interested in the last user match, so it was easy to remove the user query.

I'm not sure what you mean by coming in a row or separate times, but I can describe what happens:

I win/lose/tie a game on HS and my tracker sends the match information to hearthstats. I look under the recent games in constructed, and there are multiple copies of the match (sometimes even an entire page+ of the last match I played). This seriously messes up the statistics because all of a sudden I have 20 more losses, or 20 more wins. Then I need to delete each match (and wait for the page to reload).

trigun0x2 commented 8 years ago

That's really weird why that would happen.. But I've merged the PR! :+1:

trigun0x2 commented 8 years ago

@Dbz can you go ahead and test the patch? It's deployed

Dbz commented 8 years ago

@trigun0x2, will do. I'm currently traveling over the next 48 hours, but I will post an update as soon as I play some matches.