New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "cuid" from JSON #603

Closed
DigitalArchmage opened this Issue Mar 3, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@DigitalArchmage
Copy link

DigitalArchmage commented Mar 3, 2015

Looking in the JSON, I noticed that "cuid" is a personal index for a monster. "1" is the starter dragon which I still have. The thing is, this index remains in-tact after evos/uevos, etc.

First, the problem I saw:

I just updated a Red Sonia and then re-synced padherder. Padherder didn't know which of my Red Sonias was updated.

One had a bunch of + eggs, one had very few. Padherder had to decide which red sonia to delete and update the other - but the other, it just didn't update. So now it looks like I have two red sonias with lots of + eggs, one of which is evo'd.

It might not have been so bad if it "picked the wrong one", except all my teams with Ronias on them are now wacked out (and I have a zillion teams, I really like the teams feature, by the way). In most of these cases, monsters were removed, and a monster which doesn't exist in the game (high plus egged previous ronia) now exists in padherder.

My suggestion: use the "cuid" from gung ho. If someone imports JSON data - here's are my thoughts:

  1. Drop rows from your table where you have known CUIDs that no longer appear in the JSON list
  2. Drop rows from your table where cards have no known CUID and are a card # that doesn't appear in the JSON list
  3. Of the remaining rows with CUIDs, update those with matching CUIDs that are in the JSON list.
    3a) and at this point on, disregard any from the JSON list that were matched correctly.
  4. Of the remaining rows(no CUIDs) match them up by card # (tricky if dups - but that's the boat you're currently doing everything for, from what I gather) and
  5. For matches found in 4, update your table with the CUID, once it's found a match so it no longer has to guess again
  6. Finally, import any yet unmatched monsters w/cuids from the JSON.

The two lists should now be synced.

A way to make 4/5 easier is to delete anything that you haven't found CUIDs for yet, and import them (this breaks teams).

Not meaning to be disparaging, I really like padherder a lot. Thanks for all the great work. I'm very impressed by the entire project.

@DigitalArchmage

This comment has been minimized.

Copy link

DigitalArchmage commented Mar 13, 2015

I did another import, same issue, but this time it deleted entire teams. I guess if the thing you evo'd is a team leader, it eats the team entirely when it deletes the team leader. (This time, I had un-evo'd the same red sonia so I could run Pad Z again).

I don't even know how many teams got eaten, I have so many. And it's not the teams that make me sad as much as it's all the extensive notes that I write in the notes area.

I hope you consider the method I suggest (so that monsters' rows are updated rather than deleted immediately) - I can't trust import as it is.

Edit - are my teams truly gone - can they be restored for me? (Teams have their own team index - I'm a little surprised the entire team would be deleted just because a monster "doesn't exist")

@madcowfred

This comment has been minimized.

Copy link
Owner

madcowfred commented Oct 11, 2015

Hi there, I've finally gotten around to implementing this. I just imported my box and nothing seems to have caught on fire, hopefully it's much better behaved for you in future.

re:edit, the teams disappeared because the leader was deleted - they're referenced as a link to your monster and can't be null. There's a possible solution to this (set the leader to blank) but it would involve a bunch of code changes :\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment