alexander-pick / MKMTool

MKMTool ist a helper application I wrote for tinkering around with optimization of sale processes on magiccardmarket.eu and the idea of automisation of some tasks most people wouldn’t be able to get done by pure manpower.
GNU Affero General Public License v3.0
65 stars 15 forks source link

Can't import complete CSV file created by MKMTool #36

Closed pepev12 closed 3 years ago

pepev12 commented 3 years ago

Hi, First of all thanks for develop such a fantastic tool. I´m having a problem using it. First I export a CSV from the tool using View Inventory - Export CSV. Then i try to import that same CSV in Price External List - Import CSV File, and it works for many of the items, but not for all, these are some of the errors i´m getting: Error with importing line #28, article will be ignored: The specified Swamp (V.3) and expansion ID 38 do not match - product cannot be identified. Error with importing line #1061, article will be ignored: The specified Rat Token (B 1/1) // Food Token (V.2) and expansion ID 2587 do not match - product cannot be identified. Error with importing line #157, article will be ignored: The specified Orzhov Guildgate (V.1) and expansion ID 2411 do not match - product cannot be identified. Error with importing line #1054, article will be ignored: The specified Knight Token (W 2/2 Vigilance) // Food Token (V.1) and expansion ID 2587 do not match - product cannot be identified. Error with setting card language: Unknown language "T-Chinese". Allowed values (case sensitive): English; French; German; Spanish; Italian; Simplified Chinese; Japanese; Portuguese; Russian; Korean; Traditional Chinese. Language of the current item will be ignored. Error with setting card language: Unknown language "S-Chinese". Allowed values (case sensitive): English; French; German; Spanish; Italian; Simplified Chinese; Japanese; Portuguese; Russian; Korean; Traditional Chinese. Language of the current item will be ignored.

The errors are always like that, a problem with S-Chinese and T-Chinese or matching name and expansion when () are used in the name. Any ideas of what can i do? thanks!

pepev12 commented 3 years ago

Well, first obvious thing, changing the name with external editor from "T-Chinese" to "Traditional Chinese" and "S-Chinese" to "Simplified Chinese" works for that kind or error, more worried about the other one, i will post here any advancement, thanks,

pepev12 commented 3 years ago

Another advance; cards with () in the name different than (V.1) (V.2), etc works well, so i think this is not the () but the dot '.'

pepev12 commented 3 years ago

A workaround, until fixed, (if possible): 1.-Export the file with mkmtool 2.-Open it with external editor (i use libreoffice) 3.-Do a search\replace "T-Chinese" with "Traditional Chinese" 4.-Do a search\replace "S-Chinese" with "Simplified Chinese" 5.-Add a new column in file named "idProduct" 6.-Manually search the card in mkminventory.csv, cards with different versiones (V.1 V.2, etc) are listed sequentially, so Swamp (v.3) is the third Swamp listed. 7.-Grab the number in the idProduct column from mkminventory.csv and copy it to the column with the same name we added in our original csv 8.-Save and close, now the file will be imported ok,

tomasjanak commented 3 years ago

Hi, I'm not sure where exactly is the T/S-Chinese problem coming from, but it should not be difficult to fix. I won't be able to do it this month, but unless someone else does it, I'll do it next month.

For the (V.1)/(V.2) problem, this is basically un-fixable on the import side: while the product webpage on cardmarket.com shows the (V.xx) as part of the name, it is actually not part of the name in the database the API uses. As such, the product ID is the only way to correctly identify those cards...and the only way to get the product ID is from the mkminventory.csv as you described, it is not displayed anywhere on cardmarket's website. The problem is mentioned in the readme https://github.com/alexander-pick/MKMTool#Price-External-List in the import section (the block of bold text for bullet point number 2). I sort of expect cardmarket to modify their databases in the future to solve this issue in some way, since Wizards are showing they are about to print many more cards with the same name but different versions so it will be more and more of a problem for anyone trying to use the API, not just MKMTool. But for now, this is how it is.

However, in your specific case of using the list obtained from View Inventory, we could fix this problem there. The product id is actually obtained for your cards, it's just not shown in the user interface and not exported. There is even a "TO DO" comment in the code that we should somehow let the user choose what is and isn't exported (https://github.com/alexander-pick/MKMTool/blob/master/MKMTool/StockView.cs, lines 82-87). I don't plan to change it anytime soon, but if you are compiling MKMTool yourself, a simple workaround is to just comment out / delete the line 85 (articles.Columns.Remove(MCAttribute.ProductID);). This way product ID will remain as a column in the window and also in the exported file.

pepev12 commented 3 years ago

That all sound great, thank you very much tomasjanak,

I will learn how to compile the code, since if for me very time consumig having to search for the id manually,

thanks!

tomasjanak commented 3 years ago

2019 is OK, I used it for the latest MKMTool versions myself. The free version (I think it's called community or something) is enough. Also, recently there was another non-programmer trying it, check out this thread, you will likely run into similar issues like him: https://github.com/alexander-pick/MKMTool/issues/33#issuecomment-621677069

pepev12 commented 3 years ago

Thanks Tomas, i deleted the message since i finnaly found the 2015 version, i will try to use it, lets see, regards,

pepev12 commented 3 years ago

Hi, Just to update, i did the changes in the code and compile, and now it works just fine (with the exception of having to mannualy change T-Chinese and S-Chinese) I did found the same problems that the other user has when compiling, but i managed trough them thanks to the other thread, thanks!

tomasjanak commented 3 years ago

The S/T-chinese problem fixed in commit https://github.com/alexander-pick/MKMTool/commit/448131e9701b3684473b2fedfa1186aba143509a Product ID is now available in View Inventory (commit https://github.com/alexander-pick/MKMTool/commit/5939d98109f72a6e795f61e320155d7fc3f3f529) Both available in version 0.8.0.0 or newer