mirror of
https://github.com/arcan1s/ffxivbis.git
synced 2025-04-25 09:47:18 +00:00
ariyala settings
This commit is contained in:
parent
df8fa43344
commit
608854dad7
17
README.md
17
README.md
@ -84,12 +84,14 @@ Service which allows to manage savage loot distribution easy.
|
|||||||
* `database`: database provide name, string, required. Allowed values: `sqlite`.
|
* `database`: database provide name, string, required. Allowed values: `sqlite`.
|
||||||
* `priority`: methods of `Player` class which will be called to sort players for loot priority, space separated list of strings, required.
|
* `priority`: methods of `Player` class which will be called to sort players for loot priority, space separated list of strings, required.
|
||||||
|
|
||||||
* `web` section
|
* `ariyala` section
|
||||||
|
|
||||||
Web server related settings.
|
Settings related to ariyala parser.
|
||||||
|
|
||||||
* `host`: address to bind, string, required.
|
* `ariyala_url`: ariyala base url, string, required.
|
||||||
* `port`: port to bind, int, required.
|
* `request_timeout`: xivapi request timeout, float, optional, default 30.
|
||||||
|
* `xivapi_key`: xivapi developer key, string, optional.
|
||||||
|
* `xivapi_url`: xivapi base url, string, required.
|
||||||
|
|
||||||
* `sqlite` section
|
* `sqlite` section
|
||||||
|
|
||||||
@ -97,3 +99,10 @@ Service which allows to manage savage loot distribution easy.
|
|||||||
|
|
||||||
* `database_path`: path to sqlite database, string, required.
|
* `database_path`: path to sqlite database, string, required.
|
||||||
* `migrations_path`: path to database migrations, string, required.
|
* `migrations_path`: path to database migrations, string, required.
|
||||||
|
|
||||||
|
* `web` section
|
||||||
|
|
||||||
|
Web server related settings.
|
||||||
|
|
||||||
|
* `host`: address to bind, string, required.
|
||||||
|
* `port`: port to bind, int, required.
|
4
package/ini/ffxivbis.ini.d/ariyala.ini
Normal file
4
package/ini/ffxivbis.ini.d/ariyala.ini
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[ariyala]
|
||||||
|
ariyala_url = https://ffxiv.ariyala.com
|
||||||
|
request_timeout = 1
|
||||||
|
xivapi_url = https://xivapi.com
|
@ -20,8 +20,9 @@ class AriyalaParser:
|
|||||||
|
|
||||||
def __init__(self, config: Configuration) -> None:
|
def __init__(self, config: Configuration) -> None:
|
||||||
self.ariyala_url = config.get('ariyala', 'ariyala_url')
|
self.ariyala_url = config.get('ariyala', 'ariyala_url')
|
||||||
|
self.xivapi_key = config.get('ariyala', 'xivapi_key', fallback=None)
|
||||||
self.xivapi_url = config.get('ariyala', 'xivapi_url')
|
self.xivapi_url = config.get('ariyala', 'xivapi_url')
|
||||||
self.request_timeout = config.getfloat('ariyala', 'request_timeout')
|
self.request_timeout = config.getfloat('ariyala', 'request_timeout', fallback=30)
|
||||||
|
|
||||||
def __remap_key(self, key: str) -> Optional[str]:
|
def __remap_key(self, key: str) -> Optional[str]:
|
||||||
if key == 'mainhand':
|
if key == 'mainhand':
|
||||||
@ -62,9 +63,12 @@ class AriyalaParser:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def get_is_tome(self, item_id: int) -> bool:
|
def get_is_tome(self, item_id: int) -> bool:
|
||||||
|
params = {'columns': 'IsEquippable'}
|
||||||
|
if self.xivapi_key is not None:
|
||||||
|
params['private_key'] = self.xivapi_key
|
||||||
|
|
||||||
response = requests.get('{}/item/{}'.format(self.xivapi_url, item_id),
|
response = requests.get('{}/item/{}'.format(self.xivapi_url, item_id),
|
||||||
params={'columns': 'IsEquippable'},
|
params=params, timeout=self.request_timeout)
|
||||||
timeout=self.request_timeout)
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user