Pyfa icon indicating copy to clipboard operation
Pyfa copied to clipboard

add prices to market items

Open esunder opened this issue 4 years ago • 2 comments

#2071 Adds a price column to items in the market view

image

esunder avatar Oct 02 '20 01:10 esunder

Note: I am trying to be a good steward of the code and add some tests. However, I am having some trouble with imports. There are no tests for other columns, like price, so it is tough to mimic an existing example.

I think it is a pathing issue, but it is able to import price.py just fine. Any ideas?

ImportError while importing test module '/home/sunder/Pyfa/tests/test_modules/test_gui/test_builtinViewColumnPrice.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.6/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_modules/test_gui/test_builtinViewColumnPrice.py:8: in from gui.builtinViewColumns.price import Price gui/builtinViewColumns/price.py:23: in from eos.saveddata.cargo import Cargo eos/saveddata/cargo.py:25: in import eos.db eos/db/init.py:120: in from eos.db.saveddata import booster, cargo, character, damagePattern, databaseRepair, drone, fighter, fit, implant, implantSet,
eos/db/saveddata/cargo.py:25: in from eos.saveddata.cargo import Cargo E ImportError: cannot import name 'Cargo'

esunder avatar Oct 02 '20 01:10 esunder

Hey, regarding your PR - sorry for not replying earlier. Adding price column is easy, and I considered it in the past. The reason why it wasn't added is not to overload price sources with updates. Any kind of search or active browsing will generate requests for thousands of items per minute. While caching policy on client side is decent, I think there has to be more stuff in place to add the price column to default distribution.

  1. Batch request of multiple prices for all shown items (except for cached entries). This is not trivial thing to do, but it would benefit fitting panel as well.
  2. Some kind of extra delay after showing items before price fetching requests are sent, like 1s at least - to avoid requesting stuff during searches, but request them only for final results

And those complications are the reasons why it is not in pyfa yet. It is cool end-user feature, but avoiding heavy distributed load on price services is a must in this case imo.

I might have some time into looking how to implement it myself, but no promises. Until that, I am leaving it hanging in here.

DarkFenX avatar Nov 10 '20 20:11 DarkFenX