Skip to content

Commit

Permalink
Force min query limit to be 1 for CJK languages in the market browser…
Browse files Browse the repository at this point in the history
… too
  • Loading branch information
DarkFenX committed Aug 29, 2022
1 parent 6543a2c commit 7892e63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
evemonMinVersion = "4081"

minItemSearchLength = 3
minItemSearchLengthCjk = 1

pyfaPath = None
savePath = None
Expand Down
7 changes: 6 additions & 1 deletion service/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from service import conversions
from service.jargon import JargonLoader
from service.settings import SettingsProvider
from utils.cjk import isStringCjk

pyfalog = Logger(__name__)
_t = wx.GetTranslation
Expand Down Expand Up @@ -152,7 +153,11 @@ def processSearches(self):
requestTokens = self.jargonLoader.get_jargon().apply(requestTokens)

all_results = set()
if len(' '.join(requestTokens)) >= config.minItemSearchLength:
joinedTokens = ' '.join(requestTokens)
if (
(isStringCjk(joinedTokens) and len(joinedTokens) >= config.minItemSearchLengthCjk)
or len(joinedTokens) >= config.minItemSearchLength
):
for filter_ in filters:
filtered_results = eos.db.searchItemsRegex(
requestTokens, where=filter_,
Expand Down

0 comments on commit 7892e63

Please sign in to comment.