Menu

Struggle with own plugin and setDBPrice

General
Sven
2016-01-11
2016-02-01
  • Sven

    Sven - 2016-01-11

    Hi there,

    I try to write an own plugin for selling at Magiccardmarket by using its API.
    As first step I tried to rewrite the price update function, just to get familia with your code.
    So far so good, I managed to update the price, but my problem is, after calling setDBPrice the GUI is not updating.
    My question, is there a bug in your current snapshot or do I have to force update the gui afterwards?
    I can see the proce after restarting the Programm.
    greets
    Sven

     
  • Alena Laskavaia

    Alena Laskavaia - 2016-01-11

    Could be a bug. Current master is highly unstable. If you want to practive on stable version use v1_4_2 branch. I look briefly and I don't see change event when prices are set
    (that how ui updates it). If you confirm this on 1.4.2 version you can send me a bug.
    For you stuff for now you can force manually refresh using refresh action from MTG Database view.

     
  • Anonymous

    Anonymous - 2016-01-11

    Ok, downgrade to 1.4.2 helped. It is working now. Quite good and fast I must say. Maybe you should think to switch to the API instead of parsing the page. If Magiccardmarked is used quite often.

     
  • Alena Laskavaia

    Alena Laskavaia - 2016-01-12

    If there is is an API it is better to use an API of cause. I did not do Magicardmarket myself, it was contributed by somebody else.

     
  • kannerke

    kannerke - 2016-01-12

    I also parse MKM pages since it's much easier then using the API, but I'm interested in seeing some working implementation.
    Since it's only parsing, I assume there is only support to get price information and no support to add items to sell or to buy items?

     
  • Alena Laskavaia

    Alena Laskavaia - 2016-01-12

    You asking about this specific provider? I don't know what is implement for it.
    I have buy function implemented for other providers, you can check what is does.
    I don't have sell implementation.

     
  • Anonymous

    Anonymous - 2016-01-12

    If you use the API you are able to add cards to your sell stock, delete and way more.
    Take a look into it: https://www.mkmapi.eu/ws/documentation/API_1.1:Main_Page

     
  • kannerke

    kannerke - 2016-01-13

    I already looked at it, but I don't find it very clear.

    I also found https://github.com/evonove/mkm-sdk which uses Python (which I also use in my project),
    but I did not test it yet.

     
  • Sven

    Sven - 2016-01-15

    Hi,

    do you build in a field, which might contain the unique ID of MagicCardMarket in your Card Model?
    Such as a comment field or a unused Id field?

    Greets Sven

     
  • kannerke

    kannerke - 2016-01-15

    MKM doesn't use an unique id to address a card (only to address an item to buy/sell)
    A general card be be addressed as: https://www.magiccardmarket.eu/Products/Singles/Worldwake/Joraga+Warcaller
    -> https://www.magiccardmarket.eu/Products/Singles//<card name="">

    Alena, another thing I wanted to ask you: is there a way to put own/custom fields in the XML files of the workspace without affecting MagicAssistant? (I haven't tried yet)
    Does you tool supports multiple entries of the same card in a xml file (e.g. twice the same card, different amounts and with a custom field: 'card quality'?

     
  • Sven

    Sven - 2016-01-15

    That is only true, if you parse the page.
    If you use the API, there is an unique ID, which you can use. My problem is, that I can't save this ID in the Assistant Data Model or I don't know, where. So same question, like you. Are there free definable columns?

     
  • Alena Laskavaia

    Alena Laskavaia - 2016-01-16

    Re: definable columns
    Well yes and no. I do have properties that be attached to any db instance in form of a=b, where a is the key and b is the value. These can be read/write using API but they won't show up in any UI. I use it internally to store some rare attributes like flipId's of the cards and stuff like that. The prices though are not stored in the same data file, it is separate xml
    which are based on gatherer id, so it makes it impossible to store prices per condition (i,e diffrent prices for mint vs played vs foil etc) currently. Of cause nothing stops you from adding extra code to support something like that, and if its good I will merge it upstream.

     
  • Sven

    Sven - 2016-01-24

    I am not sure, if a deticated MkmId only for Magiccardmarket will serve a purpose for the most of the users.

    I would need this Id to save a few http requests for fetching the Id each time I do a request to Mkm.

    I will investigate the possibility for store the Id in your MagicCard-Properties.

    Thanks for the hint.

     
  • Sven

    Sven - 2016-01-31

    Hi,

    is it possible to filter "My Cards" for my custom MkmId Field via sourcecode?
    I am grabbing cards from Mkm and I would like to update some states of my cards, but I don't want to iterate through the whole lib of cards. Can I use the UI filters internally for those purpose?

    I play around with DataManager.getCardHandler().getMagicDBFilteredStore().getFilter();, but without coming forward.

     
  • Alena Laskavaia

    Alena Laskavaia - 2016-02-01

    To hook up to filter you need a filter field. Otherwise just iterate over cards.
    20000 cards it won't be even notiable on modern cpu's.
    If you can hook propeties search to a filter field that would be cool and I can use that too.
    Would be similar to special field search (but special only works on card instances)

     

Anonymous
Anonymous

Add attachments
Cancel