{"action":"created","comment":{"url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments/33783059","id":33783059,"diff_hunk":"@@ -76,33 +76,38 @@ CardInfo *OracleImporter::addCard(const QString &setName,\n     cardName = cardName.replace(\"Æ\", \"AE\");\n     cardName = cardName.replace(\"’\", \"'\");\n \n-    // Remove {} around mana costs\n-    cardCost.remove(QChar('{'));\n-    cardCost.remove(QChar('}'));\n-\n-    // detect mana generator artifacts\n-    bool mArtifact = false;\n-    if (cardType.endsWith(\"Artifact\"))\n-        for (int i = 0; i < cardTextRows.size(); ++i)\n-            if (cardTextRows[i].contains(\"{T}\") && cardTextRows[i].contains(\"to your mana pool\"))\n-                mArtifact = true;\n-\n-    // detect cards that enter the field tapped\n-    bool cipt = cardText.contains(\"Hideaway\") || (cardText.contains(cardName + \" enters the battlefield tapped\") && !cardText.contains(cardName + \" enters the battlefield tapped unless\"));\n-    \n-    // insert the card and its properties\n-    CardInfo *card = new CardInfo(this, cardName, isToken, cardCost, cmc, cardType, cardPT, cardText, colors, relatedCards, upsideDown, cardLoyalty, cipt);\n-    int tableRow = 1;\n-    QString mainCardType = card->getMainCardType();\n-    if ((mainCardType == \"Land\") || mArtifact)\n-        tableRow = 0;\n-    else if ((mainCardType == \"Sorcery\") || (mainCardType == \"Instant\"))\n-        tableRow = 3;\n-    else if (mainCardType == \"Creature\")\n-        tableRow = 2;\n-    card->setTableRow(tableRow);\n-    \n-    cards.insert(cardName, card);\n+    CardInfo * card;\n+    if (cards.contains(cardName)) {\n+        card = cards.value(cardName);\n+    } else {\n+        // Remove {} around mana costs\n+        cardCost.remove(QChar('{'));\n+        cardCost.remove(QChar('}'));\n+\n+        // detect mana generator artifacts\n+        bool mArtifact = false;\n+        if (cardType.endsWith(\"Artifact\"))\n+            for (int i = 0; i < cardTextRows.size(); ++i)\n+                if (cardTextRows[i].contains(\"{T}\") && cardTextRows[i].contains(\"to your mana pool\"))\n+                    mArtifact = true;\n+\n+        // detect cards that enter the field tapped\n+        bool cipt = cardText.contains(\"Hideaway\") || (cardText.contains(cardName + \" enters the battlefield tapped\") && !cardText.contains(cardName + \" enters the battlefield tapped unless\"));","path":"oracle/src/oracleimporter.cpp","position":47,"original_position":47,"commit_id":"5e1566046e7609242dffadfe4df0ed4b2ed28adb","original_commit_id":"5e1566046e7609242dffadfe4df0ed4b2ed28adb","user":{"login":"Daenyth","id":14644,"avatar_url":"https://avatars.githubusercontent.com/u/14644?v=3","gravatar_id":"","url":"https://api.github.com/users/Daenyth","html_url":"https://github.com/Daenyth","followers_url":"https://api.github.com/users/Daenyth/followers","following_url":"https://api.github.com/users/Daenyth/following{/other_user}","gists_url":"https://api.github.com/users/Daenyth/gists{/gist_id}","starred_url":"https://api.github.com/users/Daenyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daenyth/subscriptions","organizations_url":"https://api.github.com/users/Daenyth/orgs","repos_url":"https://api.github.com/users/Daenyth/repos","events_url":"https://api.github.com/users/Daenyth/events{/privacy}","received_events_url":"https://api.github.com/users/Daenyth/received_events","type":"User","site_admin":false},"body":"It occurs to me that this will fail for a case like:\r\n\r\n```\r\nDudebro, the man of the very long cardname\r\nDudebro enters the battlefield tapped\r\n```\r\n\r\nI'm not sure any such card exists right now, or if we care even if it does.","created_at":"2015-07-02T14:28:06Z","updated_at":"2015-07-02T14:28:06Z","html_url":"https://github.com/Cockatrice/Cockatrice/pull/1190#discussion_r33783059","pull_request_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190","_links":{"self":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments/33783059"},"html":{"href":"https://github.com/Cockatrice/Cockatrice/pull/1190#discussion_r33783059"},"pull_request":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190"}}},"pull_request":{"url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190","id":39054652,"html_url":"https://github.com/Cockatrice/Cockatrice/pull/1190","diff_url":"https://github.com/Cockatrice/Cockatrice/pull/1190.diff","patch_url":"https://github.com/Cockatrice/Cockatrice/pull/1190.patch","issue_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1190","number":1190,"state":"open","locked":false,"title":"oracle: fix broken import of sets; fix #1188","user":{"login":"ctrlaltca","id":1631111,"avatar_url":"https://avatars.githubusercontent.com/u/1631111?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltca","html_url":"https://github.com/ctrlaltca","followers_url":"https://api.github.com/users/ctrlaltca/followers","following_url":"https://api.github.com/users/ctrlaltca/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltca/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltca/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltca/orgs","repos_url":"https://api.github.com/users/ctrlaltca/repos","events_url":"https://api.github.com/users/ctrlaltca/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltca/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-02T07:23:43Z","updated_at":"2015-07-02T14:28:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6a797b6308f3fa3e3d08553376bfb686a1d9500","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190/commits","review_comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190/comments","review_comment_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1190/comments","statuses_url":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/5e1566046e7609242dffadfe4df0ed4b2ed28adb","head":{"label":"ctrlaltca:fix_1188","ref":"fix_1188","sha":"5e1566046e7609242dffadfe4df0ed4b2ed28adb","user":{"login":"ctrlaltca","id":1631111,"avatar_url":"https://avatars.githubusercontent.com/u/1631111?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltca","html_url":"https://github.com/ctrlaltca","followers_url":"https://api.github.com/users/ctrlaltca/followers","following_url":"https://api.github.com/users/ctrlaltca/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltca/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltca/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltca/orgs","repos_url":"https://api.github.com/users/ctrlaltca/repos","events_url":"https://api.github.com/users/ctrlaltca/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltca/received_events","type":"User","site_admin":false},"repo":{"id":20678592,"name":"Cockatrice","full_name":"ctrlaltca/Cockatrice","owner":{"login":"ctrlaltca","id":1631111,"avatar_url":"https://avatars.githubusercontent.com/u/1631111?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltca","html_url":"https://github.com/ctrlaltca","followers_url":"https://api.github.com/users/ctrlaltca/followers","following_url":"https://api.github.com/users/ctrlaltca/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltca/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltca/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltca/orgs","repos_url":"https://api.github.com/users/ctrlaltca/repos","events_url":"https://api.github.com/users/ctrlaltca/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ctrlaltca/Cockatrice","description":"A cross-platform virtual tabletop for multiplayer card games","fork":true,"url":"https://api.github.com/repos/ctrlaltca/Cockatrice","forks_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/forks","keys_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/teams","hooks_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/hooks","issue_events_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/issues/events{/number}","events_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/events","assignees_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/assignees{/user}","branches_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/branches{/branch}","tags_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/tags","blobs_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/statuses/{sha}","languages_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/languages","stargazers_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/stargazers","contributors_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/contributors","subscribers_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/subscribers","subscription_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/subscription","commits_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/issues/comments{/number}","contents_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/contents/{+path}","compare_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/merges","archive_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/downloads","issues_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/issues{/number}","pulls_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/pulls{/number}","milestones_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/milestones{/number}","notifications_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/labels{/name}","releases_url":"https://api.github.com/repos/ctrlaltca/Cockatrice/releases{/id}","created_at":"2014-06-10T08:50:45Z","updated_at":"2015-05-07T06:58:21Z","pushed_at":"2015-07-02T13:31:31Z","git_url":"git://github.com/ctrlaltca/Cockatrice.git","ssh_url":"git@github.com:ctrlaltca/Cockatrice.git","clone_url":"https://github.com/ctrlaltca/Cockatrice.git","svn_url":"https://github.com/ctrlaltca/Cockatrice","homepage":"","size":30791,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Cockatrice:master","ref":"master","sha":"8407d7cc36c7bc23b456ae92b2a2023d3d01359e","user":{"login":"Cockatrice","id":9746249,"avatar_url":"https://avatars.githubusercontent.com/u/9746249?v=3","gravatar_id":"","url":"https://api.github.com/users/Cockatrice","html_url":"https://github.com/Cockatrice","followers_url":"https://api.github.com/users/Cockatrice/followers","following_url":"https://api.github.com/users/Cockatrice/following{/other_user}","gists_url":"https://api.github.com/users/Cockatrice/gists{/gist_id}","starred_url":"https://api.github.com/users/Cockatrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cockatrice/subscriptions","organizations_url":"https://api.github.com/users/Cockatrice/orgs","repos_url":"https://api.github.com/users/Cockatrice/repos","events_url":"https://api.github.com/users/Cockatrice/events{/privacy}","received_events_url":"https://api.github.com/users/Cockatrice/received_events","type":"Organization","site_admin":false},"repo":{"id":2907031,"name":"Cockatrice","full_name":"Cockatrice/Cockatrice","owner":{"login":"Cockatrice","id":9746249,"avatar_url":"https://avatars.githubusercontent.com/u/9746249?v=3","gravatar_id":"","url":"https://api.github.com/users/Cockatrice","html_url":"https://github.com/Cockatrice","followers_url":"https://api.github.com/users/Cockatrice/followers","following_url":"https://api.github.com/users/Cockatrice/following{/other_user}","gists_url":"https://api.github.com/users/Cockatrice/gists{/gist_id}","starred_url":"https://api.github.com/users/Cockatrice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cockatrice/subscriptions","organizations_url":"https://api.github.com/users/Cockatrice/orgs","repos_url":"https://api.github.com/users/Cockatrice/repos","events_url":"https://api.github.com/users/Cockatrice/events{/privacy}","received_events_url":"https://api.github.com/users/Cockatrice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cockatrice/Cockatrice","description":"A cross-platform virtual tabletop for multiplayer card games","fork":false,"url":"https://api.github.com/repos/Cockatrice/Cockatrice","forks_url":"https://api.github.com/repos/Cockatrice/Cockatrice/forks","keys_url":"https://api.github.com/repos/Cockatrice/Cockatrice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cockatrice/Cockatrice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cockatrice/Cockatrice/teams","hooks_url":"https://api.github.com/repos/Cockatrice/Cockatrice/hooks","issue_events_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/events{/number}","events_url":"https://api.github.com/repos/Cockatrice/Cockatrice/events","assignees_url":"https://api.github.com/repos/Cockatrice/Cockatrice/assignees{/user}","branches_url":"https://api.github.com/repos/Cockatrice/Cockatrice/branches{/branch}","tags_url":"https://api.github.com/repos/Cockatrice/Cockatrice/tags","blobs_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/{sha}","languages_url":"https://api.github.com/repos/Cockatrice/Cockatrice/languages","stargazers_url":"https://api.github.com/repos/Cockatrice/Cockatrice/stargazers","contributors_url":"https://api.github.com/repos/Cockatrice/Cockatrice/contributors","subscribers_url":"https://api.github.com/repos/Cockatrice/Cockatrice/subscribers","subscription_url":"https://api.github.com/repos/Cockatrice/Cockatrice/subscription","commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cockatrice/Cockatrice/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cockatrice/Cockatrice/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cockatrice/Cockatrice/contents/{+path}","compare_url":"https://api.github.com/repos/Cockatrice/Cockatrice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cockatrice/Cockatrice/merges","archive_url":"https://api.github.com/repos/Cockatrice/Cockatrice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cockatrice/Cockatrice/downloads","issues_url":"https://api.github.com/repos/Cockatrice/Cockatrice/issues{/number}","pulls_url":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls{/number}","milestones_url":"https://api.github.com/repos/Cockatrice/Cockatrice/milestones{/number}","notifications_url":"https://api.github.com/repos/Cockatrice/Cockatrice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cockatrice/Cockatrice/labels{/name}","releases_url":"https://api.github.com/repos/Cockatrice/Cockatrice/releases{/id}","created_at":"2011-12-03T20:58:09Z","updated_at":"2015-07-02T00:31:51Z","pushed_at":"2015-07-02T13:31:32Z","git_url":"git://github.com/Cockatrice/Cockatrice.git","ssh_url":"git@github.com:Cockatrice/Cockatrice.git","clone_url":"https://github.com/Cockatrice/Cockatrice.git","svn_url":"https://github.com/Cockatrice/Cockatrice","homepage":"","size":38675,"stargazers_count":273,"watchers_count":273,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":177,"mirror_url":null,"open_issues_count":219,"forks":177,"open_issues":219,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190"},"html":{"href":"https://github.com/Cockatrice/Cockatrice/pull/1190"},"issue":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1190"},"comments":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/issues/1190/comments"},"review_comments":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190/comments"},"review_comment":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/pulls/1190/commits"},"statuses":{"href":"https://api.github.com/repos/Cockatrice/Cockatrice/statuses/5e1566046e7609242dffadfe4df0ed4b2ed28adb"}}}}